----------------------------------- Paul Fri Jan 30, 2004 1:45 pm roulette, ball number correlation. ----------------------------------- I am going to be making a roulette game, I checked another roulette game on Compsci, but it didn't have any correlation between where the ball stops and the number picked. I would like to know if there is a way of doing so, and which would be easier, having the animation correspond to the random number picked? or having the number picked correspond to a random animation? ----------------------------------- TheXploder Fri Jan 30, 2004 2:01 pm ----------------------------------- I think the best way of doing this is having the time limit be random so it takes the spinnage to stop longer or shorter... this could be done as number incresing and the limit changes every time you run it. var limit : int := Rand.Int(50,200) var count : int := 0 loop count := count + 1 if count = limit % stop rotation end if end loop that's to start you up... Good Idea, why not make it Russian Roulette... hehe... ----------------------------------- Paul Fri Jan 30, 2004 2:05 pm ----------------------------------- interesting idea, using that, I'd have to figure out the spin per second and the range of time each slot on the wheel corresponds to. ----------------------------------- shorthair Fri Jan 30, 2004 2:08 pm ----------------------------------- I like that way , but making hte spin time static , wouldnt be that bad , id worry about getting hte app started first , teh spin time can be changesd easily ----------------------------------- we64 Fri Jan 30, 2004 2:44 pm ----------------------------------- paul started to make so many gambling games... you better open a casino :lol: :lol: ----------------------------------- TheXploder Sat Jan 31, 2004 12:54 am ----------------------------------- here I got an example of acceleration and deceleration: var limit : int := Rand.Int (50, 200) var count : int := 0 var speed := 1 loop if count >= 10 and count = 20 and count = limit - 20 and count = limit - 10 then speed := 1 end if count := count + speed put count if count >= limit then put "spin stoppend" exit end if delay (10) end loop ----------------------------------- we64 Sat Jan 31, 2004 8:38 am ----------------------------------- cool that is how you change the speed, but how to you make the wheel spin :?: ----------------------------------- shorthair Sat Jan 31, 2004 9:02 am ----------------------------------- you just set the draw variables , to draw from whatever variables you are using for the accelerate and decelerate, when you hardcode drawing numbers , you cant do things like this , but you can make a drawing dependant on whats going on in the program ----------------------------------- Paul Sat Jan 31, 2004 12:42 pm ----------------------------------- This is going to take some pondering... I'm probably going to work on this sometime on the weekends, its still only february, I have plently of time (I think). ----------------------------------- we64 Sat Jan 31, 2004 8:02 pm ----------------------------------- here is spining drawoval (100, 100, 52, 52, black) for x : 1 .. 360 drawfillarc (100, 100, 50, 50, 0 + x - 1, 10 + x - 1, white) drawfillarc (100, 100, 50, 50, 0 + x, 10 + x, red) delay (10) end for ----------------------------------- TheXploder Sat Jan 31, 2004 8:17 pm ----------------------------------- good job, here I added my acceleration/deceleration code to your code: var limit : int := Rand.Int (360, 720) var count : int := 0 var speed := 1 loop if count >= 10 and count = 20 and count = limit - 20 and count = limit - 10 then speed := 1 end if count := count + speed drawfillarc (100, 100, 50, 50, 0 + count - speed, 10 + count - speed, white) drawfillarc (100, 100, 50, 50, 0 + count, 10 + count, red) if count >= limit then exit end if delay (10) end loop by the way, how many numbers does the roulette wheel have? ----------------------------------- Paul Sat Jan 31, 2004 10:04 pm ----------------------------------- Ivan, you mind telling me how to use urs? it looks same as tony's ----------------------------------- Paul Sat Jan 31, 2004 10:07 pm ----------------------------------- I think mine works the best, effect wise... in slowing down. drawoval (100, 100, 52, 52, black) var a, counter:int:=1 for x : 1 .. 360 drawfillarc (100, 100, 50, 50, 0 + x - 1, 10 + x - 1, white) drawfillarc (100, 100, 50, 50, 0 + x, 10 + x, red) delay (a) counter:=counter+1 if counter = 5 then counter:=1 a:=a+1 end if end for ----------------------------------- TheXploder Sat Jan 31, 2004 10:20 pm ----------------------------------- Paul I said that I added my code to we64's code, and If you notice the rotation speeds up and slows down and spins further each time... duh PS: Who is Ivan, lol... most people won't get who you are talking to... refer to me as 'Xploder' or 'TheXploder'... ----------------------------------- Paul Sat Jan 31, 2004 10:22 pm ----------------------------------- I still think my way is easier to understand, cause for yours I didn't understand what all the numbers did. We're not all hardcore coders like you Xplo. ----------------------------------- TheXploder Sat Jan 31, 2004 10:30 pm ----------------------------------- fine, yours is better I admit it, just one update.. just I think it slows too abruptly.. ----------------------------------- Paul Sat Jan 31, 2004 10:31 pm ----------------------------------- you can change it with the counter ----------------------------------- we64 Sat Jan 31, 2004 10:38 pm ----------------------------------- he... I got the basic codes, you just added or changed it :wink: ----------------------------------- Boarder16 Sat Jan 31, 2004 10:39 pm ----------------------------------- i agree with him ----------------------------------- Paul Sat Jan 31, 2004 10:42 pm ----------------------------------- yes, because we all know how hard it was to make the animation, it might have taken me several hours :lol: ----------------------------------- TheXploder Sat Jan 31, 2004 11:03 pm ----------------------------------- But the problem with your's paul is it stops at the same spot every time, look at this code, I improved the old code... var limit : int := Rand.Int (360, 720) var count : int := 0 var speed : int := 1 var speedInc : int := 1 drawoval (100, 100, 52, 52, black) loop speedInc := speedInc + 1 if count >= 0 and count < round (limit / 2) then if speedInc >= 20 then speed := speed + 1 speedInc := 1 end if end if if count >= round (limit / 2) then if speedInc >= 20 then speed := speed - 1 speedInc := 1 end if end if if speed >= 5 then speed := 5 end if count := count + speed if speed = limit then exit end if delay (15) end loop I like when we learn from eachother, isn't that what we are here for... not to say, oh look at my code, oh see you took my code, waz up with that, your the one asking for help and we r just trying to improve on it.. ----------------------------------- Paul Sat Jan 31, 2004 11:07 pm ----------------------------------- we're joking dude, nice code. ----------------------------------- we64 Sat Jan 31, 2004 11:16 pm ----------------------------------- TheX, pretty nice... ----------------------------------- shorthair Sat Jan 31, 2004 11:36 pm ----------------------------------- Play nice boys , no need for the spam posts paul , or else you get in trouble for posting to mcu h :lol: :lol: , Wow ive become addicted to teh spam section , i have 92 popts that dont count in my post count , im like a junkie for it now ----------------------------------- Paul Sun Feb 01, 2004 12:07 am ----------------------------------- I might not have time to work on this, you guys feel free to make your own roulette programs. ----------------------------------- shorthair Sun Feb 01, 2004 12:12 am ----------------------------------- ohhhhh , thakns , i already tried and ended up making poker , i wish i could find it, my blackjack was my greatest game so far ----------------------------------- Paul Sun Feb 01, 2004 12:16 am ----------------------------------- cool, I might ponder a bit on making black jack. ----------------------------------- shorthair Sun Feb 01, 2004 12:19 am ----------------------------------- it was my midterm project in compsci this year ( have you seen it , its way back somewher ein the files , posted it when i first joined , thought i was hott stuff ( i was wrong ) ) ----------------------------------- Paul Sun Feb 01, 2004 2:49 pm ----------------------------------- Heh, if I were told to make blackjack right now, I would have little idea on how to go about it. I'll try to find yours using search. ----------------------------------- Cervantes Sun Feb 01, 2004 2:58 pm ----------------------------------- the best kinds of projects are the ones that you have little idea how to go about doing. You learn best doing those kinds of projects. DO IT!! *ahem* if you want to :eh: ----------------------------------- Paul Sun Feb 01, 2004 2:59 pm ----------------------------------- Shorhair, which picture did you use for the card cover? isn't she that singer? ----------------------------------- shorthair Sun Feb 01, 2004 3:25 pm ----------------------------------- on blackjack , if so that denise richards , actress