End a game (win conditions) -solved-

Get help using Construct 2

Post » Sun Jan 22, 2012 11:42 pm

Hi,
I'm creating -lets say- a space shooter game. and i want to end the game when all ships on the screen is destroyed by player. to achive that i've tried to use ship is on-screen option but it seems like this condition is for the actual object not its' instances. so what should i use for it?

i'm a newb. sorry if it's an easy question.kontinyu2012-01-23 09:43:01
B
11
S
1
Posts: 17
Reputation: 649

Post » Mon Jan 23, 2012 12:04 am

use the "compare two values" system condition and use the 'ship.count' expression for the first value.

if ship.count = 0 then ......
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Jan 23, 2012 12:41 am

im kind of trying to do the same thing, i want that when there is already a shotgun in the map no new shotgun will be spawned.



http://dl.dropbox.com/u/58024177/shooter2.capx
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Mon Jan 23, 2012 9:42 am

[QUOTE=keepee] use the "compare two values" system condition and use the 'ship.count' expression for the first value.

if ship.count = 0 then ......[/QUOTE]

thank you sir!
B
11
S
1
Posts: 17
Reputation: 649

Post » Mon Jan 23, 2012 5:17 pm

@spexel: this is not relevant to this topic.

But anyway:
dd a condition to your event 10
System: compare two values
Compare Shotgun.count = 0

For this to work you also need to add a shotgun.destroy in start of layout (event 9)


Also in your event 10 you use a random function.
This means that every tick, this value gets changed. You probably should rather use a global variable, and assign it in the action of event 10, not in the conditions of event 10
(each time event 10 gets executed, you set the next random time a shotgun will spawn).
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795


Return to How do I....?

Who is online

Users browsing this forum: Lof, YoHoho and 20 guests