Flappin Bird Template Help

Discussion and feedback on Construct 2

Post » Sat Feb 15, 2014 3:26 pm

Hello, I have C2 for a long time but only now i start development with it. I am a Delphi coder and I have difficulties with the script system. I need some help in this:

In Flapping Bird template, how can i make bird fly through 3 secondes before the obstacle start to come?

Thanks in advance for help.
B
26
S
1
G
2
Posts: 5
Reputation: 1,790

Post » Sat Feb 15, 2014 3:35 pm

first idea:

add global variable StartCounter
every second add +1

generate obstacles only if StartCounter > 3

reset StartCounter on every fail
B
18
S
7
G
1
Posts: 783
Reputation: 4,247

Post » Sat Feb 15, 2014 3:42 pm

Thanks for you prompt reply. My problem is not de logic or algorithm but how to implement it. The event sheet is a good idea but it is very different of a language like Pascal, for example. For example, i need som example of how to post an event that only allows obstacles start to come when my global variable reach 3, as in you example.
B
26
S
1
G
2
Posts: 5
Reputation: 1,790

Post » Sat Feb 15, 2014 4:26 pm

1.) Adding a variable.
-- right click on the event sheet
-- select the variable option
-- name your variable, set the initial value
-- close the prompt

2.) Updating the variable.
-- (double) click in the event sheet
-- select "system", then find "every X seconds" and add it
-- enter the amount you want (1 in the example above)
-- close the prompt
-- select the newly created event, click right of the conditions to create a new action
-- select "system", then find "add to (global variable?)"
-- select the variable you created
-- enter an amount of 1
-- close the prompt

3.) Checking if the variable is >3.
-- create an event, similarly as above, this time select "compare values"
-- have the second value be 3
-- have the selector window be greater than
-- click in the window of the first value, select system, then find your variable in the list and click it, it will be added to the textbox
-- close the prompt

Modify the actions of this event to only create obstacles if the condition is true.
This depends on the coding of the example you speak of, can't help you here.

What i'd do additionally would be to add a check to the "add to value" event so that the event is only modified while its value is <3, as any actions to it are obsolete after it reaches 3, unless you want to use it afterwards.

Also, creating a Flappy Bird clone isn't a good way to start developing games with C2, you should check out some of the tutorials to get a better grasp of how C2 works. I mean, honestly, the way logic of C2 works is somewhat similar to Delphi/Pascal or most conventional programming languages once you get yourself familiarized with the way the program looks.

Update: can't count to 3.Stiivais2014-02-15 20:49:52
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Sat Feb 15, 2014 5:01 pm

If you tie the logic to the start of layout event then you can start your 3 second count from there.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Sat Feb 15, 2014 5:14 pm

Thanks a lot, people. I will try the example. generally, i pick a working example of a new language that i am learning to study. For me, it is better than tutorials. It is just a matter of how the tool works.
B
26
S
1
G
2
Posts: 5
Reputation: 1,790


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests