Calculation
12 posts • Page 1 of 1
Calculation
ok i have got 8 calculations
scene.my.counter = 0
scene.my.counter1 = 0
scene.my.counter2 = 0
scene.my.counter3 = 0
scene.my.counter4 = 0
scene.my.counter5 = 0
scene.my.counter6 = 0
scene.my.counter7 = 0
scene.my.counter8 = 0
now i got 8 "text" counters in a row but i want counter to go up to 9 then reset back to 0 and make counter1 = 1 then go up to 9 then reset to = 0 and make counter2 = 1 and you get the idea how could i solve this please?
scene.my.counter = 0
scene.my.counter1 = 0
scene.my.counter2 = 0
scene.my.counter3 = 0
scene.my.counter4 = 0
scene.my.counter5 = 0
scene.my.counter6 = 0
scene.my.counter7 = 0
scene.my.counter8 = 0
now i got 8 "text" counters in a row but i want counter to go up to 9 then reset back to 0 and make counter1 = 1 then go up to 9 then reset to = 0 and make counter2 = 1 and you get the idea how could i solve this please?
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: Calculation
I've done this before. I can't remember now. I'm so tired right now. I'll try in the morning eh? 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Calculation
Just so I've got it. You want to raise a value when it resets right. Like 1-9 and 10 = 0 and if counter8 = 0 then add 1 to counter7?
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Calculation
counter 8 always counts up there is no deduction
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: Calculation
(e)={Scene.my.counter == 9 ? {scene.my.counter = 0; scene.my.counter1 = scene.my.counter1 + 1} : {}}
Translated to English: If scene.my.counter equals nine, then scene.my.counter1 equals whatever it was before, plus one. Just keep repeating that, and add in your own code when necassary. I think that's right
Translated to English: If scene.my.counter equals nine, then scene.my.counter1 equals whatever it was before, plus one. Just keep repeating that, and add in your own code when necassary. I think that's right
-

kilebantick - Posts: 1267
- Joined: Tue Sep 01, 2009 9:50 am
Re: Calculation
theres one problem if the first counter gets hit untill the second counter gets to 8 and then 9 it carries on past 9 and doesnt reset untill somthing collides with it, is there anyway past this problem?
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: Calculation
Yeah, i had to make a revision of the code, turns out i was using = instead of ==
Just take a look at the code again, it works for me
Just take a look at the code again, it works for me
-

kilebantick - Posts: 1267
- Joined: Tue Sep 01, 2009 9:50 am
Re: Calculation
Hey is there anyway to autoupdate each counter with a laser collision because if a counter does not get a collision it goes past the reset counter and does not reset at all even when it collides i could use <= but i would still have the problem of counters going past 9.
Thanks for everyone who has helped so far
Thanks for everyone who has helped so far
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: Calculation
Ah, the console variables for it (The scene.my) auto-update one hundred time a second. I don't know what you're talking about. Explain more fully?
-

kilebantick - Posts: 1267
- Joined: Tue Sep 01, 2009 9:50 am
Re: Calculation
ok i will just use 3 counters to make it easier for now
ok so scene.my.counter = 8 then it gets hit again + 1 = 9 = 0 = scene.my.counter1 = 1 so on and so on untill you get to this
scene.my.counter = 8 scene.my.counter1 = 8 scene.my.counter +1 = 9 = 0 = scene.my.counter1 +1 =9 = 0 which should make scene.my.counter2 = 1 but it doesnt make it 1 it just makes scene.my.counter1 reset without adding onto counter 2 or it just keeps counting up past 9
ok so scene.my.counter = 8 then it gets hit again + 1 = 9 = 0 = scene.my.counter1 = 1 so on and so on untill you get to this
scene.my.counter = 8 scene.my.counter1 = 8 scene.my.counter +1 = 9 = 0 = scene.my.counter1 +1 =9 = 0 which should make scene.my.counter2 = 1 but it doesnt make it 1 it just makes scene.my.counter1 reset without adding onto counter 2 or it just keeps counting up past 9
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: Calculation
Hmmm.
I think you know how to do the other part of it. That codes been tested, and it works
- Code: Select all
(e)=>{
Scene.my.one >= 8 ? {
Scene.my.two = scene.my.two + 1;
scene.my.one = 0
} : {};
Scene.my.two >= 8 ? {
scene.my.three = scene.my.three + 1;
scene.my.two = 0
} : {};
scene.my.three >= 8 ? {scene.my.three = 0} : {}
}
I think you know how to do the other part of it. That codes been tested, and it works
-

kilebantick - Posts: 1267
- Joined: Tue Sep 01, 2009 9:50 am
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest





