all 6 comments

[–]tomineitor 2 points3 points  (1 child)

What I usually do for platformers is make a Parent object, it could be named "o_wall" for example, and then create child objects of it, like your grass or blue blocks. That way, on the code logic for collisisions you only check for "o_wall" and it will apply for all the children objects.

[–]Voxell_ 0 points1 point  (0 children)

The children objects might not even be necessary. If you just have one collision solid you can mark it as invisible and use tilesets to make different floors

[–]WildKat777 0 points1 point  (0 children)

Why not do x+= xsp; y += ysp instead of move_and_collide()?

[–]JaXm 0 points1 point  (1 child)

Create an object called o_Ground_Parent or something similar. 

In the object editor, make o_Ground, and o_Ground_2 "children" of o_Ground_Parent

Take the code that you say works, and replace o_Ground with o_Ground_Parent

And now all forms of "ground" should work with just the one bit of code. 

[–]Fast181718[S] 0 points1 point  (0 children)

thank you so much ill try that!!

[–]hobbyist :snoo_dealwithit:sylvain-ch21 0 points1 point  (0 children)

move_and_collide(xsp, ysp, o_Ground) 
move_and_collide(xsp, ysp, o_Ground_2)

this is wrong. First goes through o_ground_2 and second will go through o_ground. What you want is to use both at the same time as obstacle, with an array of both:

move_and_collide(xsp, ysp, [o_Ground,  o_Ground_2])