Restting Local Variables

Get help using Construct 2

Post » Fri Mar 02, 2012 12:59 am

How would I go about resetting the timer after a reset of the level. Whenever I reset My Level even after deactivating time group the timer keeps counting.

I'm only counting seconds up to 300 like mario but it's NOT a mario clone lol, anyhow if I die or kill boss and conticue to next level or reset I'd like the Timer to reset.

Pls any help would be amazing.

p.s if I could be a bother, to ask how I might go about using the timers(TIME) ex: I kill boss and I have 193 points but took 30 seconds i'd like the 30 seconds to subtract from my overall score that carries on to next level as time resets.

TUT used

http://www.scirra.com/tutorials/173/time-counter

I tryed adding set time to 0 but I don't think I'm doing it rightErndog2k2012-03-02 02:08:28
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 2:54 am

You should post your capx.

As answered in the other topic, it depend on how you've set things so far.

Your score is supposed to be a global variable, your timer too, on end of the level you substract timer from score to obtain the effect you want, on restart you set the timer to 0.

Without the exact code you're using (your capx), there's not much I can tell.
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

Post » Fri Mar 02, 2012 3:48 am

OK here it comes "how do I get/extract my Capx n what is it?"
I'm guessing its my event sheet?

I bet your right, problem is that my timer is a local variable. I tryed to set the timer as global but it didn't work? for me

let me know how to extract my capx file n upload.

what upload site should I use.

I'm new to this. have been using cryengine1,2,3 for years but this is sooo easy, untill now lol.
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 3:50 am

omg I feel so dumb went to save as single file and well u know.

Only u will see it right if I password the .rar

n what upload site should i use. Erndog2k2012-03-02 03:51:52
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 4:06 am

uploadin to 2shared
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 4:11 am

Sent you a private Msg with the link and passord thanks for your time and help
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 4:42 am

I got your PM, but I won't download a 29 Mo archive.
I'm on a slow shared connexion, I'm not willing to do that.

Here's a commented capx, adapt it to your project.

Also I had linked in my previous post what the .capx format is.
Here is the link again.
Read the manual it's really worth it.

Also for your next uploads try dropbox.
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

Post » Fri Mar 02, 2012 4:59 am

Thank you for all of you suggestions I will definetly look at the manual,

your Exaple is exacly what I need thank you soo much I just need to edit the code to minus the score on finish

p.s my game so far is 45 mbs unpacked with two levels is that too big?
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 5:23 am

[QUOTE=Erndog2k]p.s my game so far is 45 mbs unpacked with two levels is that too big?[/QUOTE]
My main question is: what do you have in your game that is so large? Is it necessary?

Yes, that is probably far to big for most smaller-scope games, especially if its delivery mechanism is over the internet. Remember, whoever plays your game (if it's on the internet) has to download it (whether streaming or otherwise)! unlikely2012-03-02 05:24:52
B
13
S
6
G
2
Posts: 13
Reputation: 1,977

Post » Fri Mar 02, 2012 6:26 am

[QUOTE=unlikely] [QUOTE=Erndog2k]p.s my game so far is 45 mbs unpacked with two levels is that too big?[/QUOTE]
My main question is: what do you have in your game that is so large? Is it necessary?

Yes, that is probably far to big for most smaller-scope games, especially if its delivery mechanism is over the internet. Remember, whoever plays your game (if it's on the internet) has to download it (whether streaming or otherwise)! [/QUOTE]

Thanks for your input. I have now deleted the crapola out of a bunch of imported created instances that can be just cloned/copied from original. I don't need three of the same object in my game.

so it's now 26 mbs(unpacked) only two levels well two and a half levels.

I think it might be the layout size and rez of my background

2048,1024 I have the top 512 used for my background and game and bottom 512 used for touch controls

is this layout and rez to big for a small phone game. Erndog2k2012-03-02 06:26:56
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests