Commit Graph

14 Commits

Author SHA1 Message Date
Nathan Lovato
7eb91a6165 Use GSAI as a class prefix instead of GST
GSAI for Godot Steering AI
2020-02-11 11:33:25 -06:00
Nathan Lovato
6132a0aa25 Refactor the demos to support screen resizing
Add BackgroudLayer and DemoInterface scenes that we can reuse across demos
Set the game to 2D and extend window modes

Part of #21
2020-02-08 15:40:43 -06:00
Nathan Lovato
98d3be13f8 Simplify code in the FollowPath demo
Use draw_polyline to draw the path
Renamed some variables
2020-02-07 09:08:45 -06:00
Francois Belair
dc9a57e7fd Append _ to apply_steering and fix yield on ready 2020-02-07 09:56:03 -05:00
Răzvan C. Rădulescu
1baed58659 Review smart agents
I made minimal changes, mostly cosmetic like so:

- rename KinematicMovementType to MovementType since
  GSTKinematicBody2DAgent.KinematicMovementType.COLLIDE for example is
  really more than a mouthful with repeated Kinematic in the name
- add optional movement_type parameter to the constructor, otherwise
  we'd be forced to construct the object and then specify as an
  aditional step the type of movement if we want something else than the
  default
- rewrote the constructor to yield on ready and removed _on_body_ready
- renamed _apply_steering to apply_steering as this is a public method
- renamed _on_SceneTree_frame to _on_SceneTree_physics_frame
2020-02-07 12:29:45 +02:00
Francois Belair
2ae06d3da3 Split agent types into specialized classes 2020-02-06 16:30:53 -05:00
Francois Belair
85784791ec Add and have most demos use specialized agents
The agents auto-update themselves and can calculate their velocities.
This keeps the user from having to create an update_agent function.
It can also save the user from having to keep track of and update
velocities at all by using the provided `apply_steering` method.

Closes #15, closes #16
2020-02-06 16:00:41 -05:00
Francois Belair
57f3c4a24a Make calculate_acceleration return void
This makes the code more in line with GDQuest gdscript guidelines about
 not both transforming state and returning a value.
2020-02-06 14:46:21 -05:00
Răzvan C. Rădulescu
4fceb866f7 Use beginner 2d platformer visual style 2020-02-03 18:07:43 +02:00
Francois Belair
8228694713 Refactor var names for consistency aka min/max 2020-01-22 11:55:49 -05:00
Francois Belair
6e6f27505c Fix init time setters and export Follow variables
The use of `not is_inside_tree()` before setting the setting class' value
meant that the starting values would always be the default. Moving the
value setting before checking for tree readiness fixes the issue.
2020-01-16 12:31:02 -05:00
Francois Belair
dde2825bde Fix divide by 0 bug in FollowPath demo 2020-01-16 11:08:23 -05:00
Răzvan C. Rădulescu
f3f40848a1 Update folder structure for FoollowPath Demo 2020-01-16 15:30:55 +02:00
Răzvan C. Rădulescu
1a37b2bee0 Update project to follow GDScript guidelines closer
Used `var variable := 0.0` as discussed in the Godot issue, instead of
`var variable: = 0.0`.

Mostly these are minor/cosmetic changes, but I've also reorganized the
folder structure (naming of folders) to reflect our guidelines, plus
made some minor changes to the demo codes. Still work in progress.
2020-01-16 10:44:44 +02:00