A
alvarosaez316
Guest
Hi, I'm making Meteoric Balls, a platform game with very little inspiration in Megaman. Yesterday I was coding some idea and the sprite of the player stopped showing in-game.
Here's the code of the step event:
Alarm[0]:
Alarm[1]:
Shift Press/Release:
W press:
A (is EXACTLY the opposite with D):
Problem:Ball-Family sprites not showing, but shiftcount decreases when shift is pressed.
Here's the code of the step event:
Code:
//Custom Physics
if sprite_index=BallJump_spr {
y -= force;
if force=-13{
}
else{
force-=1;
};
if place_meeting(x,y+20,brick_obj) and jump=1
{
sprite_index=BallStill;
jump=0;
action=0
}
else{
}
}
if jump=0
{
force=12
}
if place_meeting(x,y,brick_obj)
{
}
else
{
if jump=0 or shift=0
{
y+=10
}
else
{
}
}
//Movement
if keyboard_check(ord("D"))
{
direction=0
speed=10
}
else
{
if keyboard_check(ord("A"))
{
direction=180
speed=10
}
else
{
speed=0
}
}
//God-Like movement step part
if keyboard_check(vk_shift)
{
if shiftcount>0
{
shiftcount-=1
}
else{
alarm[0]=1;
alarm[1]=450
}
}
Alarm[0]:
Code:
speed=0
sprite_index=Rolling
Code:
shiftcount=100
Code:
//Press
shift=1
sprite_index=Magic
//Realease
shift=0
sprite_index=BallStill
Code:
if shift=1
{
direction=90
speed=10
shift=0
alarm[0]=50
}
else{
sprite_index=BallJump_spr
jump=1
action=1
}
Code:
//Shift check
if shift=1
{
direction=180
speed=10
shift=0
alarm[0]=50
}
else{
if sprite_index=BallStill
{
sprite_index=Rolling
}
else
{
}
image_angle-=9
}
Last edited by a moderator: