Jump to content


Photo

Questions for a topdown shooter


  • Please log in to reply
2 replies to this topic

#1 Pix1

Pix1

    GMC Member

  • New Member
  • 1 posts
  • Version:GM8

Posted 03 May 2012 - 04:58 PM

I'm trying to make my very first game in Game Maker 8 Pro

Basically it's a top-down shooter (as in, controlling a character, picking up weapons, shooting stuff)

I have my character sprite in several different variants.. There's an "idle" sprite for when the character is stood still, a standing-and-shooting sprite, and a running-and-shooting sprite. Thanks to some internet tutorials and such I successfully made my character able to move around and fire his weapon. Here's what I have so far:

http://i46.tinypic.com/28va9zm.jpg

But I want the sprites to switch around as he does different actions, and I can't figure that out. So my questions are a little complicated, (sorry):

1. How do I make the sprite change to running-and-shooting when I press the WASD keys to move him around but still press the Left Mouse at the same time?
2. How do I make it revert back to the stand-and-shoot sprite if I stop moving but still press Left Mouse?
3. How do I make it revert back to the "idle" sprite if I stop moving AND stop shooting?

and I have one more unrelated question

4. The first weapon will be an SMG (sub-machine gun) so I obviously want my bullet object to repeat very quickly and the firing sound to repeat with it. How do I make this happen?

any help will be greatly appreciated :)

Edited by Pix1, 03 May 2012 - 05:02 PM.

  • 0

#2 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1558 posts
  • Version:GM:Studio

Posted 03 May 2012 - 05:20 PM

//in create event put 
running=0; shooting=0;

//in step event

if(shooting)
{
if(shooting)
{
sprite_index=run_n_gun;
}
else
{
sprite_index=shooting;
}
}
else if(running)
{
sprite_index=running;
}
else
{
sprite_index=idle;
}

if(!keyboard_check(ord('W'))&&!keyboard_check(ord('A'))&&!keyboard_check(ord('S'))&&!keyboard_check(ord('D')))
{
running=0;
}

and you put in the wasd key held events running=1;
and in global left mouse held put shooting=1;

and on the global release left button put shooting=0;

Edited by Jack Indie Box, 03 May 2012 - 05:21 PM.

  • 0

#3 itsosmpl

itsosmpl

    GMC Member

  • New Member
  • 7 posts
  • Version:GM8

Posted 03 May 2012 - 06:14 PM

I'm trying to make my very first game in Game Maker 8 Pro

Basically it's a top-down shooter (as in, controlling a character, picking up weapons, shooting stuff)

I have my character sprite in several different variants.. There's an "idle" sprite for when the character is stood still, a standing-and-shooting sprite, and a running-and-shooting sprite. Thanks to some internet tutorials and such I successfully made my character able to move around and fire his weapon. Here's what I have so far:

http://i46.tinypic.com/28va9zm.jpg

But I want the sprites to switch around as he does different actions, and I can't figure that out. So my questions are a little complicated, (sorry):

1. How do I make the sprite change to running-and-shooting when I press the WASD keys to move him around but still press the Left Mouse at the same time?
2. How do I make it revert back to the stand-and-shoot sprite if I stop moving but still press Left Mouse?
3. How do I make it revert back to the "idle" sprite if I stop moving AND stop shooting?

and I have one more unrelated question

4. The first weapon will be an SMG (sub-machine gun) so I obviously want my bullet object to repeat very quickly and the firing sound to repeat with it. How do I make this happen?

any help will be greatly appreciated :)


sorry im not good enough myself to help you but i do want to advise you (cause you just started making games) go for GML instead of the drag and drop. its allot easier if you learn it from the start.
good luck on your future games
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users