roulette games?

Posted on 2004-04-26
Last Modified: 2013-12-04
Hi i want to know how to make a roulette game.I mean how to generate the numbers 0-36 map on an image and also which programming language its better to do it.thanks
Question by:painkil
  • 2
LVL 11

Expert Comment

ID: 10922807
(1) Language: What language(s) do you know already? Almost without exception the answer to the question of which language should you use is what language do you know or would you like to learn. Okay, some languages are better at some things than others. You want interactive graphics.
  - Perl with Perl/Tk can draw buttons, images, and all of that. Users need a copy of Perl on their machine.
  - Java is cross platform (so is Perl/Tk), draws pictures and buttons and stuff, and users will need a copy of Java on their machine (lots of people have Java on their machine)
  - Flash and its programming language are almost designed to make this sort of thing; user needs Flash display program (and it is, to an extent, cross platform).
  - C++ is compiled into an executable program so it could be stand-alone. A given executable would NOT be cross platform (you COULD write it so that it worked on multiple platforms but any given executable would only work on one class of computers).
  - Squeak is a "visual" successor to Smalltalk. It is crossplatform, interpreted (they need a copy of Sqeak to run on a computer), and has a whole lot of graphics routines. It can be overwhelming to use for someone who uses another programming language but it can also make really pretty games.

(2) Random numbers: Depends on the language. Most modern languages support a random number generating funciton. Note that the sequence is not actually random, only pseudorandom with a very long period. Typically you can get a "random" number on some range, say 0 to 10000000. Then you figure out how to quantize the value to your desired range (many languages will even give you a number on the range 0-n-1 with a call like random(n)). So this is a specific question for the language manual

(3) Map it onto an image: Assume image is a picture of a wheel (with an appropriate alpha channel), you can use rotation to rotate the image about its center. Again, exactly how this is done depends on which programming language you use. In Java an AffineTransform could be applied before drawing the image with the amount of rotation set by which section should be at the top. Changing the amount of rotation every frame would permit you to animate the wheel spinning. Note that depending on size of the image and amount of memory on your target platform, you might want to prerender the various frames of th wheel (applying an affine transformation is expensive in terms of CPU time).

Different languages, different mechanisms for setting the rotation with which to draw the image.

Note that the above assumes you want the game to run directly on the user's computer. If you are going to put this on a Web page, then things are more interesting. Java, Flash, and Squeak have plug-ins for many browsers.

Hope this gives you some ideas on where to start.


Author Comment

ID: 10929567
which one can i used to be controlled  remotely and also be used for a touch screen?
LVL 11

Accepted Solution

bcladd earned 125 total points
ID: 10930033
(1) "controlled remotely"? What do you mean? You want to pick the numbers for the wheel from somewhere else? Or do you mean that you want one game to be played (viewed) from multiple machines? Most of these languages support networked communications with libraries (that are often part of the shipping language). Java has the NIO (new input/output) libraries, Perl has been network aware forever, Squeak has network libraries, C++ has network libraries.

(2) Touch screen: What is the target platform? If the touch screens are on Linux/Windows/Mac computers then I would bet that their drivers act pretty much like mice. Then most of these languages would work with the touch screen. If you're talking about mobile devises then I would look at J2ME, the mobile edition of Java. If it is ported to the device, it can probably use the IO of the device.

Hope this helps,

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Domain policy 6 100
Minecraft Servers 4 108
Battlefield 4 PC or PS4 2 138
Maya SDK Getting total rotation from Rotation Anim Curves 1 39
As we all know Counter Strike is a very popular computer game. Usually it is played over a network for which people create a server and users join it but it is interesting to know that one can creates a dedicated server which not only hosts the game…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question