<div dir="ltr">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:<div style>1) Learn to drawn a circle onscreen in an inline. This will eventually be your roulette wheel.</div>
<div style>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).</div>
<div style>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.</div><div style>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.</div>
<div style>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.</div><div style>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.</div>
<div style>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.</div>
<div style>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.</div>
<div style><br></div><div style>Hope that helps.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 9:19 PM, Corey Christner <span dir="ltr"><<a href="mailto:cchristner91@gmail.com" target="_blank">cchristner91@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey everyone,<br><br>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! <br>
<span class="HOEnZb"><font color="#888888"><br>-Corey<br>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/c6cecb9a-c34f-4afd-a9b3-72178bd99bb7%40googlegroups.com?hl=en-US" target="_blank">https://groups.google.com/d/msgid/e-prime/c6cecb9a-c34f-4afd-a9b3-72178bd99bb7%40googlegroups.com?hl=en-US</a>.<br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
<br>
<br>
</font></span></blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/CABkDJUd9cipoO-gUrw8ssoFMTYm3rcPOzmN4-gDKqkHRydp3Rg%40mail.gmail.com?hl=en-US">https://groups.google.com/d/msgid/e-prime/CABkDJUd9cipoO-gUrw8ssoFMTYm3rcPOzmN4-gDKqkHRydp3Rg%40mail.gmail.com?hl=en-US</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
<br />
<br />