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

screenshot of the scene

Author: Xray

Group: Default

Filesize: 290.56 kB

Date added: 2012-12-17

Rating: 5.6

Downloads: 1157

Views: 331

Comments: 10

Ratings: 3

Times favored: 0

Made with: Algodoo v2.0.2 Edu


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
Similar scenes
Title: Coin Toss
Rating: 5.625
Filesize: 216.4 kB
Downloads: 531
Comments: 3
Ratings: 2
Date added: 2012/12/17 03:37:24
Made with: Algodoo v2.0.2 Edu
Rating: rated 5.6
Title: heads and tails solution.
Rating: 5.375
Filesize: 83.98 kB
Downloads: 206
Comments: 4
Ratings: 2
Date added: 2012/12/17 09:09:38
Made with: Algodoo v2.0.2
Rating: rated 5.4
Title: coin toss
Rating: 5
Filesize: 9.72 kB
Downloads: 194
Comments: 0
Ratings: 1
Date added: 2010/08/21 01:16:02
Made with: Phun
Rating: rated 5
Title: Vending Coin Mechansim
Rating: 5
Filesize: 21.59 kB
Downloads: 192
Comments: 1
Ratings: 1
Date added: 2008/08/05 18:17:30
Made with: Phun
no image found for this scene
Rating: rated 5
Title: Milk Jug Toss Algodoo version
Rating: 5
Filesize: 51.77 kB
Downloads: 438
Comments: 1
Ratings: 1
Date added: 2016/07/01 17:09:19
Made with: Algodoo v2.1.0
Rating: rated 5
Rating: 5
Filesize: 0.9 MB
Downloads: 1783
Comments: 0
Ratings: 1
Date added: 2012/10/18 06:26:53
Made with: Algodoo v2.0.2
Rating: rated 5
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:

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