Browse Search Popular Register Upload Rules User list Login:
Search:
Gravity Switch Game Concept (Directions in description)

Image:
screenshot of the scene

Author: alasmyfoe

Group: Default

Filesize: 5.42 kB

Date added: 2016-05-16

Rating: 5

Downloads: 275

Views: 179

Comments: 13

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Use the right button to move forwards. You can not go backwards
Hold down the z key to change gravity
If stuck, press the r key to restart

Also, if you can PLEASE tell me how to put more then one keys.isdown scripts in the update or postStep spot, that would very appriceated.

This is just a concept, and this may be a game, but may be turned into a new one.

Free to use, just as long as credit is given;)
Please log in to rate this scene
edit
Similar scenes
Title: Proof of concept: pinball tilt system
Rating: 5.625
Filesize: 73.87 kB
Downloads: 968
Comments: 1
Ratings: 2
Date added: 2012/02/20 11:56:42
Made with: Algodoo before v1.8.5
Rating: rated 5.6
download
Title: [1 - 4 Players] G-Switch Map 1
Rating: 5
Filesize: 30.22 kB
Downloads: 678
Comments: 0
Ratings: 1
Date added: 2020/02/23 08:12:43
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Gravity Switch
Rating: 5.6667
Filesize: 284.58 kB
Downloads: 440
Comments: 6
Ratings: 3
Date added: 2008/11/16 22:54:54
Made with: Phun
Title: Transformer Worm Game (Read Description Before Playing!)
Rating: 5
Filesize: 48.56 kB
Downloads: 1152
Comments: 0
Ratings: 1
Date added: 2014/09/27 02:14:37
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Gravity Powered Clock V1.0
Rating: 5
Filesize: 348.74 kB
Downloads: 561
Comments: 1
Ratings: 1
Date added: 2017/03/04 14:03:54
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: 4 speed transmisson
Rating: 5.4
Filesize: 54.17 kB
Downloads: 998
Comments: 4
Ratings: 4
Date added: 2009/03/31 22:00:42
Made with: Phun
Rating: rated 5.4
download
Pretty neat! Will you do a Level 2?
You can put as many keys.isDown() statements as you like in postSetp and in update. Just make sure to place a semicolon between the scripts which separates them.
Last edited at 2016/05/16 18:10:15 by Xray
I tried that, but when I put the keys.isDown for left and right, it just broke:/
I tried it myself, and I had no problem moving script from update to postStep:

(e)=>{
keys.isdown("r") ? {
e.this.pos = [-974.5, 9.5]
} : {
collideSet = 1
};
keys.isdown("right") ? {
e.this.vel = [4, 0]
} : {
e.this.vel = [0, 0]
}
}


Just be ready to add the additional script immediately after you type the semicolun! If you attempt to type the semicolon and then add nothing else until later, it won't allow you to do that. So, highlight and then COPY the script (Ctrl-X) which will also delete it from update. Then point your cursor to the right of the next-to-last bracket in postStep (The last bracket is for the (e)=>{}) and type the semicolon. Then before you do anything else, press Ctrl-V (paste) which will paste the added script to the right of the added semicolon. Thyme is very sensitive to the sequence of how you place new code in existing code.

Try that and let me know if it works for you.
Last edited at 2016/05/16 22:37:13 by Xray
Well, im just trying to get the left and right to work on the same. when i try, it just either only goes left, or only goes right.
I don't understand. Please explain what you mean by "work on the same". The same what? If you can describe what you want to do in detail, I'm sure that I can figure out a script that will work for you.
Work in the same section, i.e. the onKey, postSep, and update tabs
It works for me, so you are obviously not doing something correctly. But I cannot help you unless you can explain in DETAIL exactly what you are doing, and at what point it fails.


Did you try to copy my script from an earlier comment, and paste it into the postStep section in your scene? If you copy/paste correctly, then you will see that it does in fact work!
Last edited at 2016/05/17 19:15:06 by Xray
Im trying to make it go left AND right
I put the script:
(e)=>{
keys.isdown("r") ? {
e.this.pos = [-974.5, 9.5]
} : {
collideSet = 1
};
keys.isdown("right") ? {
e.this.vel = [4, 0]
} : {
e.this.vel = [0, 0]
};
keys.isdown("left") ? {
e.this.vel = [-4, 0]
} : {
e.this.vel = [0, 0]
}
}
It doesn't work because every e.this.vel = [0,0] forces the velocity to be zero even though you are commanding it to move with a e.this.vel = [-4, 0] script in some other area. One simple way to get around that is to put each IF statement in the FALSE section of the previous IF statement, like this:

If this thing is true ? {then do this}:{otherwise, if this other thing is true ? {then do this}:{otherwise, if this other thing is true ?}: {etc.....} Then the last false condition would be to stop the object from moving.

So, for this actual scene, the code would look like this:


(e)=>{
keys.isdown("r") ? {
e.this.pos = [-974.5, 9.5]
} : {
collideSet = 1
};
keys.isdown("right") ? {
e.this.vel = [4, 0]
} : {
keys.isdown("left") ? {
e.this.vel = [-4, 0]
} : {
e.this.vel = [0, 0]
}
}
}

This should work. Try it! (copy and paste it into your scene)
Last edited at 2016/05/21 04:03:05 by Xray
Thanks Xray, it works =D
You're welcome! :tup:
You can use this script for both directions and resetting: (e)=>{
e.this.vel = [0, 0];
keys.isdown("left") ? {
e.this.vel = [-4, 0]
} : {};
keys.isdown("right") ? {
e.this.vel = [4, 0]
} : {};
keys.isdown("r") ? {
e.this.pos = [-974.5, 9.5]
} : {
collideSet = 1
}
}