Why does 'create object' spawn 3 objects?

Discussion and feedback on Construct 2

Post » Thu Aug 09, 2012 4:51 am

I want it to spawn just one.

here's the capx
B
4
Posts: 8
Reputation: 716

Post » Thu Aug 09, 2012 5:40 am

Ahhh, I see why. The seed bounces!

You have it set so that it grows a sapling when it collides with the ground; it just so happens that it hits the ground and bounces twice, resulting in THREE saplings instead of one.

SECOND edit: Wait a minute, I didn't even look at that "Next" variable. That does the job I just described before... Oh, the problem is that you should add 1 to Next BEFORE the "Wait 1 second" action. Then it works.

Edit: I gotta say, I'm curious about where you're going with this project. Mind throwing us a few details? SullyTheStrange2012-08-09 05:43:45
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Thu Aug 09, 2012 3:55 pm

Yeah for sure, to be honest, I'm not really sure how to get it to work, but essentially I'm trying to create a game where you start as a seed and it sprouts at the forest floor, the goal being to grow large enough to reproduce. There will be a light source at the top that needs to touch you in order to fill up your energy/mana bar, and once you've filled it up, you're allowed to grow up by one 'stem', similar to how snake works when you eat a piece of food. the 'sapling' sprite would always be at the top, and you would use the arrow keys to aim the sapling which would slowly drag the rest of the plant (which consists of a bunch of joint-connected stems) toward the light, while the base is connected to the immobile seed.

I can't figure out how to get the stem to grow from the seed and keep the sapling at the top. Seems like a pretty complicated idea so I might give up on it : (
B
4
Posts: 8
Reputation: 716

Post » Thu Aug 09, 2012 11:53 pm

So I've decided to keep at it, and I've made substantial progress. I've figured out how to make the stems attach/stack to each other and only be able to bend a certain amount, I've added a rough night/day cycle and the basic energy system (i haven't looked into the actual line-of-sight sunlight-to-leaf system yet).

I seem to be having the same issue as before with sequencing events. I'm trying to make it so that when you push the spacebar to grow after filling up enough sunlight energy (you start out with enough energy from the seed for 3 growth spurts), that a new stem pushes out from the seed and the sapling stays at the top. Could you take a look and see what I'm doing wrong? I'm so confused.

CAPX
B
4
Posts: 8
Reputation: 716

Post » Fri Aug 10, 2012 12:00 am

although I suppose it would make more sense for the new stem to grow from behind the sapling than to come up from the seed...
B
4
Posts: 8
Reputation: 716

Post » Fri Aug 10, 2012 12:25 am

Unfortunately, I have just about zero experience using Construct's physics engine, so I'm not really sure what's happening there.

I'm sure someone here could help you out, though.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112


Return to Construct 2 General

Who is online

Users browsing this forum: chadorireborn, digitalsoapbox and 15 guests