Randomly Shoot an Object that Falls

0 favourites
  • 12 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • I am working on a duck hunt remake for my first game and would like to ask, how I can randomly release an item from the bottom of the screen that shoots up into the air then falls as a shooting puck would.

    Thank you!

  • I would create a sprite that has several different animation frames. Frame 0 could be a sponge, frame 1 a television and frame 2 a water balloon.

    I would give the sprite platformer behavior. When you want to spawn an instance of that puck in the bottom center of the screen, you would give it a random x velocity from maybe -100 to 100. Then give it a Y velocity of -600 to -800 for example so it will pop up and then fall down. You would also choose which frame would be showing to represent which object you want.

    Platformer isn't necessarily designed for this because it has in mind that you would be controlling the "sprite" with the arrow keys or something. But I find that it's the easiest to manipulate still compared to physics which will have a lot of junk you don't need for a simple object being tossed up in the air and falling down. Doesn't sound you'll be wanting objects to collide or anything cause they didn't in the original game.

  • Thank you very much for the help, Ill give it a shot and let you know how it goes!

  • I'm brand new with Construct, I think I need a little more A B C with how to do this please. Thanks ahead of time!

  • give it a bullet behavior and spawn random object with random angle so it does go up straight. then when the object reaches a certain Y coordindate. slow the object down and add gravity.

    that's one way i guess.

  • Hum, ok Ill try this method as well :) Good suggestions folks!

  • Well I gave my object a bullet behavior and set spawn object every 3.0 at angle 30 and the object heads right regardless of the angle I set. If I am understanding correctly, the bullet object only sets an object going right or left?

  • That's why you shouldn't bother with the bullet behavior. Then you have to deal with angles and all that. Much easier to just give him a platform behavior. I've been there, done that. Just give him a platform and give him a little negative or positive x velocity and some negative y velocity. It'll make him pop up and drop back down.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Dwight would it be possible to pop me up an example? Im not sure how to get the object moving once I set the properties.

  • Thank you SO much for your time and effort, I really appreciate it. The math spooks me a bit though :) Is there a cheat sheet for common formulas as math is not my strong suit.

  • Merries

    Not real sure about which math formulas you need exactly so let me know what you want and I'll see what I can do. Also, start your message with "@farmerdwight" so I get alerted to your response.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)