E prime casino game code

ben robinson baltimore.ben at gmail.com
Wed May 22 13:36:10 UTC 2013


It won't be the easiest thing to do if you've never programmed before, but
not impossible. Take it one step at a time. Here's how I made a roulette
wheel recently:
1) Learn to drawn a circle onscreen in an inline. This will eventually be
your roulette wheel.
2) Learn to drawn radii at regular intervals around the circle, for as many
slices as you'll want on your wheel. Use code to iterate the drawing of the
first radius as many times as you need around the circle (For radiusNumber
= 1 to NUMBER_OF_TOTAL_RADII; Next radiusNumber).
3) Try to assign a different color to each slice for as many outcomes as
you anticipate needing on your wheel - if it's just win vs not win, you'll
only need two colors.
4) Now whatever code you've used to accomplish the above, try to make that
iterative (using a similar For Loop) so that the same wheel you've just
drawn can be drawn once for each step of a full rotation, because
eventually the wheel will need to spin and you want the colors of your
slices to travel with their respective slices around a full rotation.
5) Save each step of this iterative drawing process to a different
offScreenCanvas so that you can later copy and paste the various
offScreenCanvases onto your main cavas.
6) Draw a little arrow or something to indicate visually the location where
a winning slice will be determined. You know, the ticker thing that goes
tic-tic-tic-tic-tic like in The Price Is Right.
7) Write code to draw the wheel spinning for a period of time. Maybe find a
.wav file online for the sound of a roulette wheel spinning, and draw the
wheel spinning for as long as it takes the .wav file to play to completion.
Make sure you add enough randomness to this spinning process or it will be
easy for the participant to anticipate given the wheel's starting position,
which slice will wind up a winner.
8) Write code to check the color of the pixel shown near the point of your
arrow, and perform different actions given this color. This way, when the
wheel finishes spinning, you check to see the color of the slice
immediately in front of the arrow. This is the winning slice, and the color
of the pixel should tell you what outcome to present the participant.

Hope that helps.


On Tue, May 21, 2013 at 9:19 PM, Corey Christner <cchristner91 at gmail.com>wrote:

> Hey everyone,
>
> I'm a Junior psychology student, and am conducting an experiment dealing
> with Gambler's Fallacy this fall. I am trying to find code for a roulette
> wheel game, or at least get tips on how to write one. I'm brand new to the
> E prime program so any help would be appreciated. If you would like any
> more information or have any questions to ask, feel free!
>
> -Corey
>
> --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to e-prime+unsubscribe at googlegroups.com.
> To post to this group, send email to e-prime at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/e-prime/c6cecb9a-c34f-4afd-a9b3-72178bd99bb7%40googlegroups.com?hl=en-US
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/CABkDJUd9cipoO-gUrw8ssoFMTYm3rcPOzmN4-gDKqkHRydp3Rg%40mail.gmail.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20130522/4ac52721/attachment.htm>


More information about the Eprime mailing list