[Solved]Archievement: 100 points in 10 seconds.

Get help using Construct 2

Post » Wed Apr 03, 2013 3:48 pm

Hello Guys!
(sorry for my bad english)

In my game will have some achievements for the player to collect. I've done almost all, I'm only stuck on this:

- Make 100 or more points in 10 seconds.
(10 seconds not in the begining of the game, but any time)

I have a Global Variable called "GameScore" which has increased its value every time the player does something which should earn points (pretty obvious).

But how can I do this "Archievement"?
I think in every point earned, the system has to count points earned during the next 10 seconds and at the end it has to check if we can get 100 points or more. But that in every point! I can do 100 points in 10 seconds, then the system will do this check 100 times virtually the same time! Crazy, no?

Does anyone have any suggestions on how to do this?Oni Lo2013-04-06 00:11:28
B
13
S
4
G
1
Posts: 17
Reputation: 2,337

Post » Wed Apr 03, 2013 4:04 pm

You can do this: Each time you earn a point you s... Hmm...Well, you must us... I dunno.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362

Post » Wed Apr 03, 2013 4:30 pm

I have thought of one way of doing this ,but sure there are a few,more elegant ways...but it should work....

create an invisible sprite call it "timer",give it a variable,lets say "count"

set fade behavior to it..set fade in to 0,wait time to 10,fade out to 0
set it to destroy after fade

when you want to count your 10 seconds....

>create sprite "timer"

>Sprite "timer" is on created....set variable "count" to score

>sprite "Timer" is on screen
score => sprite timer "count"+100.....achievement done!

>achievement = not achieved
>sprite timer on destroyed.....create object "timer"

I have not tried this,but pretty sure it will work,and you could work it into your events easily.

let me know how you get on with it.


Pixel perfick2013-04-03 16:44:55
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Wed Apr 03, 2013 4:57 pm

You need a way to remember every score you added throughout time, an array seems like a good solution, although some heavy manipulation are required.

I created a small example to help you.

@Pixel perfick

Your solution is clever, but unfortunately, you are only checking for achievement completion in 10 seconds blocks, not continuously.Magistross2013-04-03 17:07:01
B
45
S
16
G
18
Posts: 845
Reputation: 13,668

Post » Wed Apr 03, 2013 5:18 pm

@magistross it is continuous,as on destroyed it creates another....that's continuous!....
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Wed Apr 03, 2013 5:24 pm

@Pixel perfick : Yes, but every 10 seconds you restart the "counter" to 0, that's what I meant by not continous ! Let's say you do 50 points in the last 5 seconds of your fading timer, then 50 other points in the first 5 seconds of the next timer, the achievement won't unlock !
B
45
S
16
G
18
Posts: 845
Reputation: 13,668

Post » Wed Apr 03, 2013 5:27 pm

I thought of the same as Pixel, but I understood that it is not what you want.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362

Post » Wed Apr 03, 2013 5:33 pm

@magistross ....Apologies...you are correct...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Wed Apr 03, 2013 5:41 pm

@Pixel perfick : No need to apologize, we're all here to help each other !
B
45
S
16
G
18
Posts: 845
Reputation: 13,668

Post » Wed Apr 03, 2013 6:29 pm

Thank you all for responding!

A solution to @Pixel Perfick's system is create a sprite "timer" every time the "GameScore" variable changes, so if the integer variable of some sprite reach 100, archivement unlocked. But as he said, is not the most elegant way, especially for a mobile game, because it envolves alot of sprites and fade behaviors. But still a way!

@Magistross. Thank you for this example. I think it's a great solution! I will work with it.
If I get something simpler (will be difficult) I'll post here.Oni Lo2013-04-03 18:33:00
B
13
S
4
G
1
Posts: 17
Reputation: 2,337

Next

Return to How do I....?

Who is online

Users browsing this forum: Radulepy, tarek2, TiagoCesar and 20 guests