In this lesson we:
The waterfall is an instance in the environment that interacts with the player. The Desired Results of this feature are:
// Waterfalls push player down
For a new feature, the first step is to determine what systems will need to be created or updated. Much like the moving platforms, this feature will impact the Player Movement System updated in Lesson 5.
For the Player Movement System, we had an architectural decision of whether:
a. Instances affecting movement interact with the player
b. Player interacts with instances affecting movement
We had implemented (b), so this new functionality will be with the player object, not the water object.
We can now reword our Desired Results to reflect how it will be implemented in the existing Player Movement System.
// Waterfalls push player down
// If in water and not in ground, accelerate down faster
With the condition and action identified, the syntax can be added. This functionality will leverage the #region Vertical Movement section of the obj_player Step Event, adding an else if conditional for when not on ground, but before assuming in the air.
// Waterfalls push player down
// If in water and not in ground, accelerate down faster
else if place_meeting(x, y, obj_water) {
// Accelerate down faster
vspeed += 2 * v_acceleration
}
To increase the value of designing unique weapons, enemies should be able to weild them along with the player. The Desired Results of this feature are:
// Every two seconds, the strong enemy fires a weapon in the direction they are facing
Being a new feature, we first determine what systems will need to be created or updated. In this case there are several: