1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Tutorial Java Game Programming

Discussion in 'Coding, Programming' started by DCCS, Mar 6, 2015.

  1. DCCS

    DCCS Forum Veteran Established

    Please or Register to view links

    Java Game Programming for Beginners

    Creating a game using Java may look daunting at first, but when you get the hang of the basics, you’ll realize that it’s a programming language designed to make things easier for developers.


    Before, triple A games were created either through C or Please or Register to view links. However, that changed when mobile gadgets took over as the most popular platform for gaming. Many games for the Android and iOS platform today are being developed using Java. Award-winning titles like Angry Birds and Temple Run were both developed using it. The first software to offer online casino entertainment back in 1996, Please or Register to view links, has jumped on the bandwagon in using Java to develop its slot machine games. One of today’s popular MMORPGs, Please or Register to view links, is also a product of Java programming.

    With these basics, you will be able to set yourself in the right direction for developing games using Java. Credits to Please or Register to view links for this easy-to-follow game programming tutorial.

    The Window
    To create a game, you’ll need to create a window to hold everything together. Here’s a snippet that will give you a 300×400 window—something that you can easily find in many Java tutorials:

    Code:

       Sorry you need to Register / Login to see this Codes!    

    With this code, you will be able to control the window of your game. You can minimize, maximize, and change the size settings to your preference. Apart from keeping things together, the window serves as a command center for the code that will manage your application’s user interface.

    Animation
    Of course, a game without animation would be pretty boring. Here’s an example of how you can code a simple moving object for your game. If you’re thinking about doing a sports game like tennis or a simple pôkêr table game with card animation, this will get you started.

    First, you need to determine the starting position of the ball (x and y). Then, to make it move, you have to modify the position with each shift.

    Code:

       Sorry you need to Register / Login to see this Codes!    

    If you already know the basics of coding in Java, this should be cake for you. But if you’re new to Java programming, there are tons of lessons that you can learn from Please or Register to view links’s tutorial pages.+
     
  2. fazz12

    fazz12 Addict Established

    nice one po sir, you should also share the basics of java programming to them then. step by step if necessary. i know it is too much for a suggestion, but as we can see, medyo kulang pa talaga sa contents ang PHC pagdating sa programming and scripting fields. of course thousands of sites and links exist throughout the net kaya pwede nilang sabihing "hindi na kailangan dito yon", pero mas maganda sana kung mismong sa PHC manggagaling yung mga tutorials mula basics, isa pa mas madali nila maiintindihan pag tagalog. ang point ko lang po is para hindi na kailanganin pang lumabas sa site natin ang mga ka PHCitizens natin para matutunan nila mga basics ng programming mula sa external sites. gusto ko din sana magshare dito ng basic knowledge sa programming, the problem is i still don't have the rights to do so kasi hindi pa ko pro. hehe sorry kung masyadong mahaba
     
  3. DCCS

    DCCS Forum Veteran Established

    Eto Please or Register to view links

    Lahat ng important programming language nandyan (y) Pwede ka namang mag-share ng knowledge mo kahit hindi ka pa pro.
     
    fazz12 likes this.
  4. fazz12

    fazz12 Addict Established

    sige thanks sa support i think gusto ko nga mag start ng programming basics thread dito sa PHC soon, starting from the legendary statement hello world pataaas. (y)(y)(y)
     
  5. DCCS

    DCCS Forum Veteran Established

    Yeah Good luck :) until makagawa ka ng "I love you Virus"
     
    fazz12 likes this.
  6. tama c boss fazz12 mgnda suggest nya para sa mga gaya ko na bago lang papasok sa mundo ng programming hehe
     
  7. patulong po ako sa sana android eclipse
    pde po ??
     
  8. this is a very good thread maganda kung makapag share din tayo dito ng e-books for reference , and ma curate yung sub-forum for other languages as well