Game Checkpoint

Discuss scenes and videos made with Algodoo.

Game Checkpoint

Postby FuzzyLogicBrain » Mon May 09, 2011 2:17 am

Rating: rated 5
Filesize: 11.85 kB
Ratings: 1
download

Phunlet-Friendly, simple, and it works. place this in your game, has collision layer A to set the checkpoint off, and col layer g for decoration. then, make something in your game that has App.undo and sim.running=false in its onlaserhit/onhitbylaser/oncollide scripting. then set off the checkpoint, and do that die condition in your game!
use this in your games!
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Tue May 10, 2011 2:25 pm

I assume that it will simply run onCollide = (e)=>{app.step; onCollide =(e)=>{}}?
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Tue May 10, 2011 4:13 pm

nope just App.step. i just made it to look apealing :)
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Tue May 10, 2011 6:34 pm

I said app.step and the onCollide thing so it would not time step twice.

But, as it changes onCollide AFTER the time step, it should restore onCollide when you undo... but then it would step again instantaneously...

Hmm. Change my earlier code so it changed the onCollide first. But then, it might fail to app.step anyway...

I don't know.

Maybe the thing to do is sim.running = false; do something obvious that says that you reached a checkpoint, do something that will delete the object when you start the sim.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Tue May 10, 2011 10:06 pm

AND, and if you put in on the kill object "(e)=>{App.undo;sim.running=false}" then it it will make a new step! and e.this.density=0 will clear the saving object up.
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Wed May 11, 2011 9:59 pm

I think you would want this code (assuming that the checkpoint is hinged to the background, and has an eccentric, very fast motor attached to it, so it will actually delete):
Code: Select all
sim.running = false;
text = "Checkpoint! Press SPACE";
color = [0, 1, 0, 1];
textColor = [1, 0, 0, 1];
collideSet = 0;
airFrictionMult = -inf
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Wed May 11, 2011 10:35 pm

umm no. all it is is a flag shaped polygon, no collision layers, attached to an invisible block, collision layer G, which has a long, strong, highly dampened spring,and that block is attached to one more invisible block, collision layer A, and in the script is on collide, (e)=>{e.this.density=0;App.step}, and the block has +inf density, (Algodoo been giving me some gyp over the past few months with glue to backround, it sees everything that is glued to the backround, and when one of them is killed via 0 density, it suddenly loosens every thing that is glued to the backround, and the glues them all together so that they fall, reason why i do it using 0 density, well it involves a laser, and i need e.geom.density=0 stuff to work it. thats why) but thats a whole different can'o'worms right there. back to it, and there are blocks set up like a pipe, col layer G. enough? (plz dont give me Kilinich type Thyme jargon, i dont understand much) and the sim.running bit is IN THE THING THAT KILLS YOUR PLAEYR! NOT THE FLAG!
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Fri May 13, 2011 5:38 pm

There's a thing that kills the player? :wtf:

My checkpoint is a box, multi-hinged to the background, with some stuff on it. The stuff would not collide, except for maybe an entrance ramp.

The box would have the code mentioned above.
It would stop the sim,
make its text very obvious that you have reached a checkpoint,
set its color to pure green,
set its text color to pure red,
and set its properties in such a way that it will delete itself and everything attached to it that is not fixed to the background when you start the sim and simultaneously cause a sim minisave.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Fri May 13, 2011 6:48 pm

0_o huh? Sounds way too complicated. Imagine a circle that you can control, then the checkpoint, then a white box. The white box has sim.running=false, and app.undo. The white box "kills" the cir, cle,,.. *click* oh you mean it kills the person playing! Ohhh. :oops: :lol:
Uummmm, you know what? *idea!!* have a large, glued-to-the-background box, and in the on collide,
Code: Select all
(e)=>{e.this.collideSet=0;
      e.this.text="Checkpoint! Press space";
      sim.running=false
}

seen as pausing sim is a step.
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Sat May 14, 2011 3:33 am

That code is basically the same as mine, but without deletion or color changing.
FuzzyLocicBrain wrote:oh you mean it kills the person playing! Ohhh. :oops: :lol:

:oops: :lol: is right. That's actually not what I meant, but I get what you're saying after rereading it five times. :roll:
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby TC42 » Sat May 14, 2011 3:51 am

How about making a beacon (in this case, alt-collider) on the player-controlled object, and using come code like
Code: Select all
{e.pos(0) > scene.my.leftchptpos && e.pos(0) < scene.my.rightchptpos} ? {app.step; e.other --or e.geom-- .density=0} : {}


Scene.my.leftchptpos and scene.my.leftchptpos would be two scalars--sorry, I've been reading a lot of vector-based stuff recently :crazy: -- AKA integers (float) for the left and right boundaries of the check-point location. You could add the two Y boundaries, but I like to keep it simple. The e.geom/other.density=0 is to stop the beacon from doing 50 steps while you are in the checkpoint area. This should work if the player-controlled object is not moving too fast.
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Game Checkpoint

Postby FuzzyLogicBrain » Sat May 14, 2011 2:40 pm

e.this.TC42= :ugeek: lul dude whut? :wtf:
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Sun May 15, 2011 8:23 pm

Basically, it checks whether or not you are in the predefined checkpoint area (which extends infinitely up and down), and if so, makes a time step and kills itself.

Hmm... You could use this.
Code: Select all
Scene.my.PointIsInBox=(P1, P2, point) =>{point(0) >= P1(0) && point(1) <= P1(1) && point(0) <= P2(0) && point(1) >= P2(1) ? {true} : {false}};

scene.my.density = 2;

scene.my.checkpoint = (topLeft, lowerRight, beacon) =>{{scene.my.PointIsInBox(topLeft, lowerRight, beacon)} ? {app.step; scene.my.density = 0} : {}}

[Credit to StandardToaster and TC42.]
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Thu Jun 02, 2011 2:20 pm

wait a second, are you targeting me!?
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Thu Jun 02, 2011 11:30 pm

Am I? Now I'm really confused.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Thu Jun 02, 2011 11:57 pm

No not you! That spammer tinybirdbrain!
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: Game Checkpoint

Postby Someone Else » Fri Jun 03, 2011 12:14 am

Please stop replying to spambots.

Keep it up and Chronos and/or RicH is/are likely so spaz upon you.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Game Checkpoint

Postby FuzzyLogicBrain » Fri Jun 03, 2011 12:51 am

They don't need an excuse to spaz on everyone. And Sonic looks like he's joining the club.
Image
these guys are awesome. <- full stop
User avatar
FuzzyLogicBrain
 
Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz


Return to Scenes

Who is online

Users browsing this forum: No registered users and 9 guests