The Daily Click ::. Forums ::. Klik Coding Help ::. Problem with My Final Project
 

Post Reply  Post Oekaki 
 

Posted By Message

Gamemaker2010



Registered
  22/10/2008
Points
  31
22nd October, 2008 at 07:54:01 -

I'm making a game with mmf2 for a final project in an online game desgin class. Im making a sidescrolling zombie shooter. Anyways i need help with something very important. I have only been using this software for about a month so i dont know much. My problem is my guns will shoot as fast as you can press the spacebar. Can someone please help me with a simple way to limit how fast your guns shoot and how much bullets are in a clip? My pistol will have unlimited ammo but i want 7 bullets in a clip can someone please help me?

 
Whats a goon to a GOBLIN?

DakaSha



Registered
  21/10/2008
Points
  32
22nd October, 2008 at 08:05:45 -

never done this but im guessing you can just set a counter... every time u shoot the counter goes +1. when it reaches 7 u make a reload event or whatever.

and for the timing of the shots u could probably use a timer. never have used one so im not sure they work like that... again u could prob use a counter though

i didnt think much about it but it should be quit simple

 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
22nd October, 2008 at 09:00:31 -

You can do like this.
Create a counter and call it "Timer".
Set initial value of Timer to 50.

Then, write this code :
+ When Timer is <50
° Add 1 to Timer

+ When "Space Bar" is pressed
+ When Timer is = 50
° Shot the Bullet
° Set Timer to 0

So.. you begin with your weapon ready to shot.
Every time you shot, the counter will be set to 0 and so you have to wait until it reach 50 to shot again.
If you think think that the gun is still shooting too fast, then you can replace the number 50 with an higher number.
If you think that the gun is now shooting too slow, you have to replace number 50 with a low number.
Obviously you don't have to rename your counter as Timer if you don't like it.
You can choose any name.. it doesn't matter

And for the reload thing, Daka system should work well


Image Edited by the Author.

 
All that I see is the years...

Lönnemyr



Registered
  30/06/2008
Points
  69
22nd October, 2008 at 21:17:45 -

Ok, I`m not sure about this so correct me if I`m wrong but can´t you just add a "every XX" condition to your event were "XX" is the delay time you want in between each shot? ..that is if you have a "while key is being pressed down" event.

 
-

Gamemaker2010



Registered
  22/10/2008
Points
  31
22nd October, 2008 at 21:52:14 -


Originally Posted by ]Alpha[
You can do like this.
Create a counter and call it "Timer".
Set initial value of Timer to 50.

Then, write this code :
+ When Timer is <50
° Add 1 to Timer

+ When "Space Bar" is pressed
+ When Timer is = 50
° Shot the Bullet
° Set Timer to 0

So.. you begin with your weapon ready to shot.
Every time you shot, the counter will be set to 0 and so you have to wait until it reach 50 to shot again.
If you think think that the gun is still shooting too fast, then you can replace the number 50 with an higher number.
If you think that the gun is now shooting too slow, you have to replace number 50 with a low number.
Obviously you don't have to rename your counter as Timer if you don't like it.
You can choose any name.. it doesn't matter

And for the reload thing, Daka system should work well


Image Edited by the Author.


THANK YOU SO MUCH!!! it worked, i set it to 25 though. What is the daka system

 
Whats a goon to a GOBLIN?

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
22nd October, 2008 at 21:54:19 -

// fire if there's enough ammo loaded
+ repeat while <fire button> is pressed
+ restrict actions for <insert delay between shots here>
+ ammo_counter > 0
-> subtract 1 from ammo_counter

// when out of ammo, add a delay while reloading
+ ammo_counter = 0
-> add 1 to reload_delay_counter

// finish reloading after this delay
+ reload_delay_counter = <whatever delay you want>
-> set reload_delay_counter to 0
-> set ammo_counter to 7




Lönnemyr: You usually don't want to use the "every..." condition. In most cases "restrict actions for..." is better.

The difference is this - "every" events are repeated at regular intervals after the start of the frame. As a result, the actual delay between the conditions being true and the action occurring, is not always constant.
"Restrict actions" events are repeated at an interval after they last occurred.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
22nd October, 2008 at 22:17:00 -

Sketchy

Ah, now when you say it, that`s true. At least I was running in the right direction

Image Edited by the Author.

 
-

Gamemaker2010



Registered
  22/10/2008
Points
  31
13th November, 2008 at 00:31:26 -

thanks for all the help. I have been working on it some more and encountered several more problems. I tried to fix it myself but i can't figure it out so i'll ask here again since last time was so helpful. Okay so im making a 2d sidescrollin zombie shooter for a final project in my game design class and i would really appreciate some help. I'm gonna try to make this as detailed as possible.

1) I made a H.U.D of 2 active objects and 2 counters. One counter is the health, its a bar with a gradient that goes green to red. One counter is the bullet counter, just numbers. One active object is the moon, not really part of the hud but i want the moon to scroll with it. And one active object is the bullet icon. The hud is in the top left corner of the screen. Now when the player reaches the middle of the screen the screen starts to scroll with the player because i set it to always>scrollings> scroll to Player 1> 0,0 relative or something like that. The problem is the counters scroll with the player and screen but the bullet icon and moon are left behind. They are active objects that are static. How can i make it scroll with the player?

2) When the reload animation starts i want it to play the reload sound as the player is reloading. So i make a new condition that says player1 is in the reload animation. then in the sound box i select play sample sound and i choose the reload sound. When i test this in the game the sound goes all crazy and messed up and the music stopps playing and all the sound in the game just changes terribly, it kindof sounds like when your tv has no reception. But when i put the sound to play anywhere else like after he is done reloading it plays fine. Can anyone help me out with this?

3) I'm not sure how to do the a certain part of the combat. The zombie is bouncing ball motion and the main character is platform movement. I'm not sure what to do when the main character gets hit by the zombie. right now the main character plays a little animation of getting hit and he gets pushed back a little bit. It looks really awkward though because it looks like he disappears and reappears a little further back. Does anyone know how to make the combat between the character and zombie better?

i might post a youtube video showing this if noone understands me. I've only been using this for about a month so im sorrry for asking so many questions but if i can fix these few but irritating problems i don't see anything else that can stop the production of my game.Any help at all is appreciated thanks. (Sorry for such a long post)



 
Whats a goon to a GOBLIN?

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2976

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
13th November, 2008 at 01:07:26 -

1.) Go to the objects properties tab and find a new tab named "scrolling" or "display" (or something like that), tick or untick (I don't remember which) the "Follow the Frame" box.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th November, 2008 at 01:30:51 -

2.) This is probably because your event is repeating continuously while the animation is playing. This causes your game to start playing another instance of the sound effect every 1/50th of a second. You need to insert a "only one action when event loops" condition into the event, and that should fix it.

Image Edited by the Author.

 
n/a

Gamemaker2010



Registered
  22/10/2008
Points
  31
13th November, 2008 at 02:16:57 -

thannk you so much it worked. 2 of my three biggest problems with this game solved in one hour. Thanks

 
Whats a goon to a GOBLIN?

Gamemaker2010



Registered
  22/10/2008
Points
  31
1st December, 2008 at 22:07:21 -

i finished the first level already. Is there a way to copy and paste everything from the first level and paste it into the second level? I want to just copy everything and paste it into the second level and edit it from there to save time because im running out of time but when i copy and paste into level 2 it looks the same but doesn't act the same is there a way i could copy and paste without having to reprogram the whole thing again and again?

 
Whats a goon to a GOBLIN?

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
1st December, 2008 at 23:08:17 -

In the storyboard editor, right click the level you made and choose copy. Then left click on it (or any other frame) and press Ctrl+V.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Gamemaker2010



Registered
  22/10/2008
Points
  31
1st December, 2008 at 23:38:30 -


Originally Posted by Jon Lambert
In the storyboard editor, right click the level you made and choose copy. Then left click on it (or any other frame) and press Ctrl+V.



Thank you so much. My main character has platform movement and i suck at animating so it looks weird when zombies attack him. Do you know a way to push the character back As if i jumped and went backwards ?

 
Whats a goon to a GOBLIN?

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
2nd December, 2008 at 00:07:59 -

Are you using the default platform movement, the platform movement object (PMO), or your own engine? That would make a difference.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
   

Post Reply



 



Advertisement

Worth A Click