• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Collision Help

S

SymbolizeLight

Guest
Im relatively new to gms (1.4) so please forgive the "noobism".

My issue is this:

I am attempting to create a platformer. Unnecessary details asside, i have a player object and several wall objects. All wall objects share a parent object that (i think) will allow me to reference all wall objects at the same time regardless of the object index. Ive read in places to use the built in collision functions and in other places to create my own collision code in the step event.

1st of all, is it better that i use the built in collision check, or code my own in the step event?

2nd of all, should i put the collision check in the player object or the parent wall object?

3rd of all, should i make seperate parents or objects to differentiate floor from wall from ceiling?

4th and lastly, i understand how the collision check functions work, but im not sure about the best way to implement them. Any info or links to info would be very mich appreciated.

Player movement would be best related to that of super mario or maybe castlevania gba. Player does NOT "accelerate" to walking speed like in super mario. Its one speed for walking and one for running.

I hope thats enough to go on. Thank you in advance.
 
T

ThePropagation

Guest
1) code your own collision check in step event: if place_meeting(player.x + horizontal_distance, player.y + vertical_distance, objWallParent) { do what you want }

2) you should put it in the player object because i'm assuming you want multiple things hitting the wall

3) if you want the collisions to work right you should have floor, wall, and ceiling objects because of what x and y positions your player is colliding with them.

4) Shaun Spalding's platformer series on youtube is great for this. The best way to impliment them that I've found is his way, to add horizontal or vertical speed to the player object until the distance is less than that from a wall. then don't add to speed.
 
S

SymbolizeLight

Guest
1) code your own collision check in step event: if place_meeting(player.x + horizontal_distance, player.y + vertical_distance, objWallParent) { do what you want }

2) you should put it in the player object because i'm assuming you want multiple things hitting the wall

3) if you want the collisions to work right you should have floor, wall, and ceiling objects because of what x and y positions your player is colliding with them.

4) Shaun Spalding's platformer series on youtube is great for this. The best way to impliment them that I've found is his way, to add horizontal or vertical speed to the player object until the distance is less than that from a wall. then don't add to speed.
Thank you. I really appreciate the orderly and straight forward answers.

Ill check out that youtube video asap.

Is it safe to assume that this will also cover of corner collisions?
 
Top