Browse Search Popular Register Upload Rules User list Login:
Search:
Coin Toss

Image:
screenshot of the scene

Author: Xray

Group: Default

Filesize: 290.56 kB

Date added: 2012-12-17

Rating: 5.6

Downloads: 1415

Views: 555

Comments: 10

Ratings: 3

Times favored: 0

Made with: Algodoo v2.0.2 Edu

Tags:

Scene tag

Since s_noonan and faytree decided to make a coin toss scene, I thought that I would join the club! :lol:

This one is a little different than theirs, in that I use the image of a real human hand and movable thumb to flip the coin. The face of the coin rapidly toggles between heads and tails until it collides with the walls of the enclosure. I also display the word Heads or Tails which follows that actual image on the coin.

Your F key (which stands for FLIP) flips the coin. Using restitution and surface velocity, I try to make the coin bounce and roll back to the thumb after each flip, but it doesn't always work, so you may occasionally need to manually place the coin back on the thumb using the move tool.

Try the other coin toss scenes, and see how mine rates against the others. Ratings and comments are much appreciated.

UPDATE: New version now includes counters that keep track of total number of heads and tails.
Last edited at 2012/12/17 16:59:01 by Xray
Please log in to rate this scene
edit
Similar scenes
Title: Coin Toss
Rating: 5.625
Filesize: 216.4 kB
Downloads: 719
Comments: 3
Ratings: 2
Date added: 2012/12/17 03:37:24
Made with: Algodoo v2.0.2 Edu
Rating: rated 5.6
download
Title: heads and tails solution.
Rating: 5.375
Filesize: 83.98 kB
Downloads: 308
Comments: 4
Ratings: 2
Date added: 2012/12/17 09:09:38
Made with: Algodoo v2.0.2
Rating: rated 5.4
download
Title: coin toss
Rating: 5
Filesize: 9.72 kB
Downloads: 262
Comments: 0
Ratings: 1
Date added: 2010/08/21 01:16:02
Made with: Phun
Rating: rated 5
download
Title: Vending machine
Rating: 5
Filesize: 444.91 kB
Downloads: 1539
Comments: 0
Ratings: 1
Date added: 2021/12/31 21:21:29
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: !CONTEST! COIN GAME
Rating: 5
Filesize: 41.13 kB
Downloads: 1070
Comments: 2
Ratings: 1
Date added: 2009/10/14 15:29:32
Made with: Phun
Rating: rated 5
download
Title: Coca cola machine
Rating: 5
Filesize: 56.8 kB
Downloads: 5377
Comments: 0
Ratings: 1
Date added: 2016/02/29 20:58:32
Made with: Algodoo v2.1.0
Rating: rated 5
download
This one is better than mine. I will rate it in a day or two after I check out the code and see if you add a counter.
@s_noonan - TOUCHE'!

I'll make a counter and get it uploaded as soon as I have Thyme. :lol:


EDIT -- NEW VERSION HAS BEEN UPLOADED! :angel:
Last edited at 2012/12/17 16:59:59 by Xray
Looks and works good. I'm not sure if I understand the heads/tails generator completely, but it appears to work well. :tup:
s_noonan - The coin OnHitByLaser generates a script that gets placed in the ControllerAcc variable. That script starts running, which toggles the heads and tails. That toggling of the heads and tails is done this way:
The texture image is a picture of a both sides of a U.S. Nickel (they are side-by-side, right next to each other). The image changes by SHIFTING the X position of the image in the textureMatrix. For a few milliseconds, the heads image shows, then the X-position changes so that the Tails image then shows for a few milliseconds, and the sequence repeats until the coin collides with a wall. The OnCollide code sticks a constant (11.0) in the ControllerAcc variable which overwrites the script that was originally put there by the OnHitByLaser code. With the script that toggles the coin image now gone, the image stays on either heads or tails depending on what was showing when the collision took place. That's it!
xray-:o
Xray - thanks for the explanation. I would not have thought to dynamically create and delete code. This may open new possibilities for me.
s_noonan - I'm glad that I was able to pass a technique along to someone else. Have fun with it! :tup:
where do you put my.scene....... ?
4 tails 1 head
LOL comments on illusions and interactive stuff. Cool!