I'm making a mario game and when Mario lands on the ground, he can't move. But when luigi lands, he can jump but not move left or right.
When they're falling, they can move left or right. what the heck? I need help.
Luigi's object:
in the the step event:
if the posion is colission free,
Execute pice of code(
Code:
gravity_direction=270;
gravity=0.2;
)
else
Execute piece of code(
Code:
gravity_direction=270;
gravity=0;
)
in the key press event(up)
if there is a collision at the relative possion(0,1)
set the verticall speet to -10
key press left:
Execute piece of code(
Code:
x-=2
)
Key press right:
execute piece of code(
Code:
x+=2
)
Collission(ground):
move to contact possion in the direction direction at most 12 'till a collision with a solid object.
Mario:
same as luigi but the verticall speed in the key press up event is -5
and in the key press left&right events replace all 2's with 4's.
Untill then, I'm gonna work on graaaaaaa2[/code]