Game Checkpoint
18 posts • Page 1 of 1
Game Checkpoint
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!
-

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
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
nope just App.step. i just made it to look apealing 
-

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
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.
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
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.
-

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
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
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!
-

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
There's a thing that kills the player?
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.
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
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.

Uummmm, you know what? *idea!!* have a large, glued-to-the-background box, and in the on collide,
seen as pausing sim is a step.
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.
-

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
That code is basically the same as mine, but without deletion or color changing.
is right. That's actually not what I meant, but I get what you're saying after rereading it five times. 
FuzzyLocicBrain wrote:oh you mean it kills the person playing! Ohhh.![]()
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
How about making a beacon (in this case, alt-collider) on the player-controlled object, and using come code like
Scene.my.leftchptpos and scene.my.leftchptpos would be two scalars--sorry, I've been reading a lot of vector-based stuff recently
-- 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.
- 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
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
-

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
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.
[Credit to StandardToaster and TC42.]
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
-

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
Am I? Now I'm really confused.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
-

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
Please stop replying to spambots.
Keep it up and Chronos and/or RicH is/are likely so spaz upon you.
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...
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.
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.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: Game Checkpoint
They don't need an excuse to spaz on everyone. And Sonic looks like he's joining the club.
-

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
18 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests






