Ending the level

For questions about using Classic.

Post » Sun Sep 05, 2010 12:56 pm

Hi guys,
New kid in town here...
The Construct is great and fun.
I built a small game in order to be familiar with the basic functionality. It's a simple game where the player needs to hit 15 balloons with its bows. When the hits are 15 I want let the game run the last boom animation and then terminate. But I don't know how to do this.
Any help will be appreciated.

Here is a screen shot:

B
2
G
2
Posts: 31
Reputation: 712

Post » Sun Sep 05, 2010 1:48 pm

Try doing *whatever event* system > Application > next layout. to switch to the next layout.
B
9
S
2
G
3
Posts: 176
Reputation: 1,954

Post » Sun Sep 05, 2010 2:29 pm

Thanks.
I declared a global variable named FinishPeriod. After the 15th hit I do this variable to be increased by 1.
When it reaches to 100 then I the application is terminated.
But now I face another issue: Upon termination I want to give to player the choice of leaving the game or let him try again... In other words I don't know how to create and operate a menu...

BTW: Here is my progress so far:
[url:1fylqbgj]http://www.mediafire.com/file/kvu6esvvszs9b7v/Balloon.zip[/url:1fylqbgj]
B
2
G
2
Posts: 31
Reputation: 712

Post » Sun Sep 05, 2010 7:15 pm

I am very impressed from the easiness of Constructor. Within a few hours I've manage to learn and build a minimal game. It's a great tool!
Here is my first complete project.

[url:28co9u91]http://www.mediafire.com/file/kvu6esvvszs9b7v/Balloon.zip[/url:28co9u91]
B
2
G
2
Posts: 31
Reputation: 712

Post » Sun Sep 05, 2010 8:31 pm

[quote="pap560":2p8ltawc]Thanks.
I declared a global variable named FinishPeriod. After the 15th hit I do this variable to be increased by 1.
[url:2p8ltawc]http://www.mediafire.com/file/kvu6esvvszs9b7v/Balloon.zip[/url:2p8ltawc][/quote:2p8ltawc]

well this might sound somewhat technical but dont just do this:

number of hits >= 15
> add 1 to global finishperiod

this is against the timedelta rules and the period will be dependant on the refresh speed of the monitor, instead try:

> add timedelta to global finishperiod

timedelta is a system variable that will always return one second when added every tick and is screen refresh screen independant. maybe someone could explain that better :)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Mon Sep 06, 2010 5:30 am

Thanks for the info, ramma. This information lights a bit, to my darkness of Constructor!
B
2
G
2
Posts: 31
Reputation: 712

Post » Mon Sep 06, 2010 1:18 pm

A timeline might help here

Create a new timeline and keep it as a separate object if you're using other timelines already (this will prevent future issues).

Set the first period (eg "Main") to -1 duration, making it run indefinitely
Set the second period (eg "Timeout") to however long you want the delay to be, eg. 2 seconds.

When your trigger event starts (eg. arrow hits = 15) end the first period ("Main")
Set the layout to change/end when the timeout period ends

OR

Make a function "end layout" using the function object
When arrow hits = 15, call function after delay of eg. 2000ms
B
2
G
2
Posts: 42
Reputation: 734

Post » Tue Sep 07, 2010 6:33 am

Hi Squish,
indeed, this is a better solution for handling time events. I changed the project according to your guides lines.

Here is the updated project for all newcomers (like me) to Construct:
[url:16ftwi73]http://www.mediafire.com/file/rjut7gqhsqqaq8f/Balloon01.zip[/url:16ftwi73]

Thanks for the tip.
B
2
G
2
Posts: 31
Reputation: 712

Post » Tue Sep 07, 2010 4:23 pm

Mediafire seems to be dead for some reason - I'll get back to you.


http://downforeveryoneorjustme.com/mediafire.com
B
2
G
2
Posts: 42
Reputation: 734


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests

cron