Jump to content


Photo

HEEEEEELP!


  • Please log in to reply
8 replies to this topic

#1 Taylor Ringo

Taylor Ringo

    GMC Member

  • GMC Member
  • 87 posts

Posted 21 October 2011 - 03:51 PM

Okay for those of you WHO HAS A GAME PAD!! I need help programming the action for button #2 where the player shoots bullets one by one, instead of him shooting like some crazy AK-47 holder!!! PLEASE HELP MEEEE!!!!
  • 0

#2 RPSR1994

RPSR1994

    GMC Member

  • GMC Member
  • 330 posts
  • Version:GM8

Posted 21 October 2011 - 03:58 PM

If you have a "key 2 event" try switching to a "key press 2 event". Other than that you may need to give more details
  • 0

#3 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1624 posts
  • Version:GM8

Posted 21 October 2011 - 06:04 PM

Okay for those of you WHO HAS A GAME PAD!! I need help programming the action for button #2 where the player shoots bullets one by one, instead of him shooting like some crazy AK-47 holder!!! PLEASE HELP MEEEE!!!!



Do what RSPR1994 said. If you are using a variable to check if he's shooting then make sure you set it back to false when the first bullet goes.

Trivial: The AK-47 (Kalashnikov) can also be semi-automatic (you set it). Was wielding one of them when I was in the army :P
  • 0

#4 Taylor Ringo

Taylor Ringo

    GMC Member

  • GMC Member
  • 87 posts

Posted 21 October 2011 - 06:17 PM

Okay what I meant was the button 2, as in the on the game pad, when i press it the bullets go one by one here is my code (note this is d&d) :




Mouse Event Joystick 1 Button 2:
If ammo is larger than 0;
{
if sprite_index is equal to stand_left;

create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 180;


if sprite_index is equal to stand_right;

create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 0;

set varible ammo to -1;

}






  • 0

#5 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1624 posts
  • Version:GM8

Posted 21 October 2011 - 07:54 PM

Mouse Event Joystick 1 Button Press 2

Or something like that
  • 0

#6 SI II man

SI II man

    GMC Member

  • New Member
  • 83 posts

Posted 21 October 2011 - 09:14 PM

You have this:

Mouse Event Joystick 1 Button 2:
If ammo is larger than 0;
{
if sprite_index is equal to stand_left;

create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 180;


if sprite_index is equal to stand_right;

create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 0;

set varible ammo to -1;

}

I would suggest a timing loop
put this in your step

//not actual gml
if timing=0 {
   if ammo>0 {
      {
      if sprite_index is equal to stand_left;
      create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 180;
      if sprite_index is equal to stand_right;
      create moving instance of BULLET relative to (0,0) at the speed of 12 in the direction of 0;
      set varible ammo to -1;
      }
   timing= time in seconds * room_speed
   }
if timing>0 timing -=1

if this helped you press the reputation button
  • 0

#7 Jakyl11

Jakyl11

    GMC Member

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

Posted 21 October 2011 - 09:39 PM

Actually I would suggest this extension as its really good, tho the only draw back is you cant do a deactivation unless you re-initialize the gamepad and can lead to unwanted results.
http://gmc.yoyogames...howtopic=378771
  • 0

#8 Taylor Ringo

Taylor Ringo

    GMC Member

  • GMC Member
  • 87 posts

Posted 21 October 2011 - 09:41 PM

okay is this GML or is it D&D? because i don't think its D&D (drag n drop) because the fact there is no timing action, I mean there's sleep, time line, and alarm actions, but the thing is that I don't see the (timing). so is this a time line action, alarm, or sleep action?
  • 0

#9 loverock125

loverock125

    GMC Member

  • GMC Member
  • 1624 posts
  • Version:GM8

Posted 21 October 2011 - 09:43 PM

okay is this GML or is it D&D? because i don't think its D&D (drag n drop) because the fact there is no timing action, I mean there's sleep, time line, and alarm actions, but the thing is that I don't see the (timing). so is this a time line action, alarm, or sleep action?


Please see my post. That should fix the problem.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users