I am making a Top-Down shooter for my brother. Having not made any games in ages, I thought it would be an idea to go into more in-depth than I previously did.
I've set up the simple W,A,S,D movement and pointing towards the mouse in code, but no matter how hard I try, I can't seem to implement a 'slowing' feature where if you hold shift, the character stops running and goes into a 'stable' or 'slow' mode where it's able shoot again.
The 'Step'/Movement code I have at the moment is:
// Face Mouse ++++++++++++++++
moving = false
image_angle = direction;
move_towards_point(mouse_x,mouse_y,0);
// Movement ++++++++++++++++++
if keyboard_check(ord("A")) //Move with A key
{
x-=5
sprite_index = spr_pitaboo_running
moving = true
}
if keyboard_check(ord("D"))
{
x+=5
sprite_index = spr_pitaboo_running
moving = true
}
if keyboard_check(ord("W"))
{
move_towards_point(mouse_x,mouse_y,5)
sprite_index = spr_pitaboo_running
moving = true
}
if keyboard_check(ord("S"))
{
move_towards_point(mouse_x,mouse_y,-2)
sprite_index = spr_pitaboo_shooting
moving = false
}
// Image Speed ++++++++++++++++++++++++
if speed=0
{
image_speed=0
image_index=0
}
if speed>0
{
image_speed=1
}
Can anyone help me here?
I have Game Maker 8.0 pro, if you haven't already worked that out.
Thanks,
Dan
Edited by Nightmax, 22 June 2012 - 12:36 PM.











