Randomly Shoot an Object that Falls

Get help using Construct 2

Post » Sun May 12, 2013 9:47 pm

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!
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Sun May 12, 2013 10:19 pm

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.
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Sun May 12, 2013 11:24 pm

Thank you very much for the help, Ill give it a shot and let you know how it goes!
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Mon May 13, 2013 12:18 am

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!
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Mon May 13, 2013 12:26 am

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.
B
40
S
10
G
5
Posts: 102
Reputation: 6,602

Post » Mon May 13, 2013 12:35 am

Hum, ok Ill try this method as well :) Good suggestions folks!
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Mon May 13, 2013 12:46 am

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?
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Mon May 13, 2013 2:14 am

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.
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Mon May 13, 2013 2:23 am

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.
B
19
S
5
G
2
Posts: 14
Reputation: 2,050

Post » Mon May 13, 2013 3:18 am

@Merries

Here's an example.

https://dl.dropboxusercontent.com/u/123756210/DuckHuntExample.capxfarmerdwight2013-05-13 03:51:38
B
10
S
3
Posts: 102
Reputation: 1,888

Next

Return to How do I....?

Who is online

Users browsing this forum: heliogame, Yahoo [Bot] and 17 guests