Build Man
Member
I have just recalled a fragment of my memory dump from a video about Sonic game physics engine. Among else, there was stated that physics engine uses Advance layer and Backside layer(al least that is what I remember them named), and player character shifts between these by touching specialized beacons - and the beacon part is where I considered total rework of Speedway Interactions.
Now speedways will be solid for the Protagonist, but only when he runs through the specialized beacon with Sandals on(The Protagonist is not supposed to jump onto speedways, or land on them anyways). This saves some troubles, but the new system is not perfect still.
Here, you can see that the Protagonist just runs off speedway instead of snapping onto straight tile and assuming new angle. I will try to figure out how to make the Protagonist snap nicely onto the straight tile. I will let you know if I am succesful or not, but you can give your suggestions anyway.
By the way, here is the new experimental version with mentioned rework - https://www.mediafire.com/file/uuyywg5vyylkckf/Legend_of_Mako_Experimental_12.gmk/file
If you are concerned about how this all is coded, the code related to speedways is in spoiler below:
Now speedways will be solid for the Protagonist, but only when he runs through the specialized beacon with Sandals on(The Protagonist is not supposed to jump onto speedways, or land on them anyways). This saves some troubles, but the new system is not perfect still.
Here, you can see that the Protagonist just runs off speedway instead of snapping onto straight tile and assuming new angle. I will try to figure out how to make the Protagonist snap nicely onto the straight tile. I will let you know if I am succesful or not, but you can give your suggestions anyway.
By the way, here is the new experimental version with mentioned rework - https://www.mediafire.com/file/uuyywg5vyylkckf/Legend_of_Mako_Experimental_12.gmk/file
If you are concerned about how this all is coded, the code related to speedways is in spoiler below:
Collision Event with speedway_parent
Collision event with beacon_speedway
Alarm 9
End Step
The code is incomplete, but first, some issues must be solved before I continue it. The last code is so the Protagonist would not get stuck in a speedway.
Code:
if sprite_index = Mako_SandalSpeed && speedways = true && other.angle = 0
{
speedways = true
alarm[9] = 10
image_angle = 0
if hspeed > 0
motion_set(image_angle,speed)
if hspeed < 0
motion_set(image_angle,-speed)
}
if sprite_index = Mako_SandalSpeed && speedways = true && other.angle = 45
{
speedways = true
alarm[9] = 10
image_angle = 45
if hspeed > 0
motion_set(image_angle,speed)
if hspeed < 0
motion_set(image_angle,-speed)
}
if sprite_index = Mako_SandalSpeed && speedways = true && image_angle = 45 && other.angle = 90
{
speedways = true
alarm[9] = 10
image_angle = 90
if vspeed > 0
motion_set(image_angle,speed)
if vspeed < 0
motion_set(image_angle,-speed)
}
Code:
if sprite_index = Mako_SandalSpeed
{
speedways = true
alarm[9] = 10
}
Code:
speedways = false
if image_angle != 0
{
image_angle = 0
}
Code:
if place_meeting(x,y,speedway1)
{
if image_angle = 45
{
move_outside_solid(225,1)
}
}
Last edited: