Trying to spawn ONE (1) object

For questions about using Classic.

Post » Tue Jun 30, 2009 6:51 pm

Hi!

I am completely inexperienced using constuct, I have just gone through the ghost tutorial and am halfway through the platform tutorial, so the solution here is probably pretty easy. (I have had fun figuring every thing else out, but this is frustrating me)

I have started to make a pong/breakout game where I want to add in some other challenge every ten points. I have got the basic pong part down, but when the player gets to ten points, I want a moving block to appear in the middle of the play area.

The problem is, I can't get one block to be created, I get blocks created constantly as long as the player is at ten points, and then it stops when he gets to 11.

Thanks!
B
1
G
3
Posts: 2
Reputation: 829

Post » Tue Jun 30, 2009 7:00 pm

There is an option under,

System-Special conditions-Trigger once while true.

So try adding that to the same condition you are using to create the block.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Jun 30, 2009 7:41 pm

Thanks, I found it!

It still doesn't work right, though. Here is the cap [url:1z3ygkpx]http://www.box.net/shared/hvbk3r77sb[/url:1z3ygkpx]. I am not sure what I am doing wrong, but the slider that I want to show up in the middle doesn't even show up now, and I forget how I got it there in the first place. My screen jumps a little when the score hits ten like it is trying to do something, but doesn't.

Thanks again, I know these questions are extremely basic.
B
1
G
3
Posts: 2
Reputation: 829

Post » Tue Jun 30, 2009 9:19 pm

I put "trigger once" into a sub-event of "is global variable 'create slider'=1" and moved the actions into that sub-event. That seemed to work. It might also work to change 'create slider' back to 0 after its created.
B
77
S
49
G
24
Posts: 346
Reputation: 16,909

Post » Tue Jun 30, 2009 9:31 pm

Hey Rostasky, sorry i dropped out of chat, my internet was crashing

I took a look at it, and it seems the trigger event needs to be a subevent. you'll see the option down below the insert new condition option. Then move the events onto the subevent and it will work.

As a side note, there is a crop tool in the image editor, and pressing 5 on the number pad(check numlock) will center the action point so when things turn around they will stay centered.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Jun 30, 2009 10:44 pm

System: 0 Is global variable 'CreateSlider' Equal to 1
> SystemCreate object Slider 0 on layer 1 at (DisplayWidth/2, DisplayHeight/2)
> SystemSet global variable 'CreateSlider' to 0
> SliderSet angle to 90
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests