Manual: Course Movement (CourseFollow2D and CoursePlatform2D)

About this manual

This manual explains ACTION GAME MAKER’s course feature. It covers both “CourseFollow2D”, which moves objects along a course, and “CoursePlatform2D”, which becomes a floor that moves along a course.

How courses work in ACTION GAME MAKER

A course lets you draw a “path” on the map and move things along it. The path itself belongs to “Course2D”, and there are two ways to use it.

Use What moves What it is for
Course (object) The game objects placed under the course Enemies flying a fixed route, rotating obstacles, patrolling items
Course (platform) The platform itself (a floor you can stand on) Lifts going up and down, platforms drifting sideways, minecarts

The course is drawn the same way in both. What differs is “who moves” and “whether you can stand on it”.

Placing one

  1. Open a map in the map editing view.
  2. From the add menu on the “Map Layers” dock, choose “Course (object)” or “Course (platform)”.
  3. A Course2D and its child (a CourseFollow2D or a CoursePlatform2D) are created together.
  4. Draw the shape of the course and configure what moves along it.

With “Course (object)”, put the game object you want to move under the “CourseFollow2D” that was created. With “Course (platform)”, the platform automatically gets child nodes for the image, the collision and the animation, so replacing the images finishes the job.

Drawing the course

Selecting the Course2D brings up the “point tool” at the top of the central view.

Tool What it does
Select Points Selects and moves points. Ctrl + click adds a point; right-click deletes one
Select Control Points Drags the handles coming off a point to shape the curve
Delete points Deletes the point you click
Close Curve Joins the start and end points into a loop

Clicking on the line inserts a point at that position (splitting the segment). A closed course goes well with looping movement; back-and-forth motion such as a lift is built with “Reverse at Endpoint” instead.

“CourseFollow2D”

Moves the game objects placed under it along the course.

  • Progress / Progress Ratio: the starting position on the course. Progress is in pixels and progress ratio is a fraction (0 to 1); changing either updates the other. You can put several objects on the same course and offset only their starting positions.
  • X Offset / Y Offset: how far from the course’s position to place things.
  • Align with Course Direction: turn it on and the object rotates to match the direction of travel.
  • Loop / Loop Count: whether to repeat after reaching the end, and how many times.
  • Reverse Direction: travels the course backwards (from the end).
  • Reverse at Endpoint: turns around at the end and comes back. Use it for back-and-forth motion.
  • Cubic Interpolation: how the curve is interpolated. On is smoother but costs more processing; off is lighter on processing but uses more memory.

The speed of travel is set per course point (see “Per-point settings” below).

“CoursePlatform2D”

A floor that moves along a course. It moves in sync with the physics, so a character standing on it is carried steadily.

The course settings (progress, offset, rotation, loop, reverse, turn-around, interpolation) are the same fields as on CourseFollow2D. In addition there are these.

  • Move Speed: how fast it travels the course (in pixels per second). A platform uses its own move speed, so the per-point move speeds on the course are ignored.
  • Speed Curve: a multiplier curve applied to the move speed. The horizontal axis is course progress (0 to 1). It lets you start slowly and speed up in the middle.

Activation (when it starts moving)

  • Mode: choose from “Always”, “Start Once” or “While Satisfied”. “Always” moves at any time without looking at the conditions. “Start Once” keeps moving once the condition has been met, and “While Satisfied” moves only while it is met.
  • Conditions: the conditions for starting to move (see the next section). With no conditions at all, it starts moving straight away.
  • Active Animation / Inactive Animation: the animations played on the child animation player when the moving and stopped states switch over. Animation tracks can change the image, toggle visibility, emit particles and so on.

CoursePlatformCondition

Conditions are evaluated from the top, combined with each one’s logical operator (AND / OR).

  • Condition Type: choose from “rider group”, “input”, “switch” or “variable”.
  • Rider Group: tests whether something in the given object group is standing on the platform. Leave it empty and any object satisfies it.
  • Input condition / Input Source: the condition when movement is driven by input. The input source can be “the object riding it”, “any controller” or “a specified controller”. That lets you build a minecart driven by whoever is riding it.
  • Switch Name / target switch: tests a switch’s value.
  • Variable name / Variable Comparison / target variable: compares a variable’s value (equal, not equal, greater than, at least, less than, at most).
  • Switches and variables can be looked up in the project database, on a specified object, or on an object from the shared board.
  • Invert condition / logical operator with the previous condition: inverts the result, or joins it to the previous condition with AND / OR.

Per-point settings

Each point on a course can carry its own settings. Open “Curve” in the Course2D’s Inspector and edit the settings inside a point (point_0, point_1, …).

  • Move speed: how fast to travel from that point to the next (CourseFollow2D only; ignored by platforms).
  • Operation switch: on reaching that point, if this switch is not set, the object stops and waits. It resumes once the switch is set. “Stop partway” is built here.
  • Variable change: changes a variable’s value on reaching that point.

Worked examples

A lift that goes up and down

  • Place a “Course (platform)” and draw the course vertically with 2 points.
  • Turn on “Reverse at Endpoint” and turn on Loop as well.
  • A move speed of around 60 gives you a floor that rises and falls gently.

A floor that only moves while you stand on it

  • Set the activation mode to “While Satisfied”.
  • Add a “rider group” condition and specify the player’s group.
  • It advances only while you are on it and stops when you get off. With “Start Once”, one step on sends it all the way.

A contraption that starts on a switch

  • Set the activation mode to “Start Once”.
  • Add a “switch” condition and specify the switch that turns ON when a lever is pulled.
  • Assigning a stopped-looking animation to Inactive Animation and a moving one to Active Animation makes it clear when it starts.

An enemy flying a fixed route

  • Place a “Course (object)” and draw the course as a curve.
  • Put the enemy object under the “CourseFollow2D”.
  • Turn on “Align with Course Direction” to bank the craft into the direction of travel.
  • Put several enemies on the same course and offset their progress (or progress ratio) to have them fly in formation.

A platform that stops partway

  • In the per-point settings, set a switch on the “operation switch” of the point where you want it to stop.
  • It stops on reaching that point and starts moving when the switch turns ON.
  • You can also use “variable change” to count the points it has passed.

Things to watch out for

  • A position where the speed curve reaches 0 becomes a point it can never leave (because the speed depends on where it currently is). A small lower bound means it does not stop completely, but near 0 it becomes extremely slow. To halt it in place, use the per-point “operation switch” instead.
  • Platforms do not use the per-point move speeds. Their speed comes from the platform’s own move speed and the speed curve.
  • Put the Course2D in the layer where game scene objects live (under ObjectRoot).
  • To line up several courses of the same shape, use duplicate (Ctrl+D) in the map layers dock.
  • Movement of an object placed on a course is handled by the course. Trying to move it with a movement template on the object side loses out to the course’s movement.