Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Creating A Java Game

Options
  • 03-01-2005 8:41pm
    #1
    Registered Users Posts: 3,695 ✭✭✭


    Hi everyone happy newe year. i am studying java in college for my second year! my fiancee has recetly bought a new phone which has monopoly on it and it has put me thinking quiet a lot over the christmas holidays about trying to create the game using java that could be played on the pc! i dont think this would be the most difficult program to do but i reckon the hardest thing to do could be to integrate some graphics into it as we have not covered how to do that yet! i would like to know what ye reckon to doing this? like would it be difficult to do and how would you go about integrating some graphics into it so that you could see the layout of the board! i know there would more than likely be a lot of system.out.print and system.out.println in it! any advice would be most appreciated! thanks in advance!

    Regards,
    John Boyle!


Comments

  • Closed Accounts Posts: 13 Miharu


    You should look in to the java 2d api for how to create the graphics:http://java.sun.com/products/java-media/2D/index.jsp

    Check out the O Reilly website for online books on java 2d too.

    Miharu


  • Closed Accounts Posts: 873 ✭✭✭neon_glows


    In college studying java aswell, this is my first year so im not very far in, we are using notepad at the moment and then compiling them with jdk in dos or something like that and then running them in the dos window, i have a few things id lilke to know though that hasnt been covered in the course yet,

    1. We are usuing a keyboard and screen code thats already been written by tonymullins.com so i want to know how you actually write the code behind this, do you have a website that explains this very easily??????

    2. I downloaded a java game that was in a zipped folder, unzipped it, uploaded the file onto my server and browsed to my server on my nokia phone for the file but could not download it. Why was that and would it have even worked if it successfully downloaded it?

    3. Is there an all round site that would be good for learning java for some one who is now got a basic understanding?

    4. Im sick of using java in a dos window, i want to make programs wiith buttons etc using java, what do i use? where do i get it from?

    5. All other java advice is well appreciated!


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    in short your not gona be using any buttons or anything like that in first year! ul have to get used to the good aul dos window! ur only a beginner! ya cant climb to the top of the ladder straight away! buy the way have a look at the top of this fourm! there are links to java resources! where are you going to college? i would prefer it if you didnt hijack my thread and started your own as you get a lot more help that way!


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    bump!!


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    anyone any advice on this?


  • Advertisement
  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh




  • Registered Users Posts: 151 ✭✭Paulmee


    John,
    Your going to need to build an application with which is split into 2 parts
    1. Game Graphics
    2. The buttons, tabs, sliders etc to control the game

    You could probably get away with using a JPanel for each part.

    The awt or swing toolkits can be used for part 2, search java.sun.com or download the javadoc
    http://java.sun.com/j2se/1.4.2/download.html#docs

    Get yourself a good java ide, I use eclipse.org but JCreator.com is grand for starting out-both programs are free.

    Use the java 2d graphics kit for graphics for your squares, circles etc.
    http://java.sun.com/products/java-media/2D/index.jsp

    Stick with 2d for starters.

    Monopoly could be quite complex to start off with if your only in 2nd year, best start off with a basic app and develop it from there. I mainly use google for help rather than a specific website. A book on 2d graphics and one on swing would help no end- i have swing 2nd edition which is useful.

    Best of luck, any problems give me a shout and ill try and help.


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    thanks guys for the info so far! this could be a challange with a steep learning curve! i hated programming so much in 1st year that i hardly went in but this year i cant get enough of it! its class!!! we have a really brilliant lecturer this year who explains everything in a way that even an idiot like me can almost always understand! i have done a good few in class assignments and have been able to do almost them all with very little help! just wanted to know how difficult this is going to be! its really bugging me and its not going to stop bugging me until i finally do it! any more input on this would be brilliant help!

    Regards,
    John Boyle


  • Registered Users Posts: 261 ✭✭HaVoC


    look here
    good oop practices perhaps too much of it but its a good starting place


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    could anyone throw some more light on this? thanks a million!


  • Advertisement
  • Closed Accounts Posts: 579 ✭✭✭Magnolia_Fan


    if your in College in Galway do you mind me asking how much Java you do in Third Year?....I think the course is Software Development. Thanks...I'd hate to get stuck with a bad programming lecturer if I transfer because I'll probably be behind in it


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    nope im in the IT in Athlone!


  • Closed Accounts Posts: 4,842 ✭✭✭steveland?




  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    how will i randomly generate the numbers on the dice?


  • Closed Accounts Posts: 839 ✭✭✭zap


    how will i randomly generate the numbers on the dice?

    da easiest way i can think of is to use the random method (can't remember its actual name) and then use an if statement or sumthing like if variable created by random method is between 0 and .15 dice = 1 else if between 1.6 and 3 dice = 2 etc.


  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    how will i randomly generate the numbers on the dice?
    import java.util.Random;
    
    ...
    
    Random rand = new Random(seed);
    int dice = rand.nextInt(6) + 1 // generates a random number from 1-6
    


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    MrPink could u provide any more information on this please? thanks!!!


  • Registered Users Posts: 4,287 ✭✭✭NotMe




  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    MrPink could u provide any more information on this please? thanks!!!
    Christ man, how are you going to survive in the workplace if you rely on everyone else to give you all the answers without taking any initive!?! Javadoc, ffs.


  • Registered Users Posts: 3,695 ✭✭✭galwaydude18


    jesus dont have a heart attack man! im only in second year and have never done anything like this before! FFS im probably going over my head trying to do this project! we have just been given the chance in college to design our own program and i have chosen to do this! just looking for some guidance and help! not too much to ask for is it?


  • Advertisement
  • Registered Users Posts: 885 ✭✭✭clearz


    Listen dude you chill the fcuk out. My first thing to say is anyone that says a game will consist of alot of System.out.println's is not ready to make one(unless its a guses the number between 1 and 100 type game). Then questions like "how will i randomly generate the numbers on the dice?" does not go down well on any boards do I here g g g google calling.

    The first game I ever made was pong and I think its a good place to start. After you have learned the basics of java graphics come back for more help.

    P.S Try to get a ball to bounce around inside the 4 sides of a window.


Advertisement