Solved

roulette games?

Posted on 2004-04-26
3
808 Views
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
0
Comment
Question by:painkil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:bcladd
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.

-bcl
0
 

Author Comment

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

Accepted Solution

by:
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,
-bcl
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

For those of you searching for a fun but also medium paced MMORPG game I would highly suggest Ragnarok Online. This MMORPG is a bit older than World of Warcraft and in a way is extremely different. Compared to WoW's 3D environment and massive wor…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

630 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