Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Java Game Question

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Java Game Question

    Hey guys, I'm making a gaming for an AP Comp Sci course using Java Applets. It involves a stick figure shooting zombies. I'm making the walking animations as GIF except for the hand and his gun which rotates depending on where you are aiming. I just wanna ask how could I do that, the aiming gun/hands? Do I calculate the slope? What kind of graphics do I need put(GIF)(Graphics g)? Thanks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,972
    My Mood
    Hungover
    Thanks
    133
    Thanked 555 Times in 476 Posts

    Default Re: Java Game Question

    To figure out the direction the hand should point, the easiest way to do that is to use some basic trig.

    I'm not sure what you mean when you ask "what kind of graphics to I need put (GIF)(Graphics g)?". I would recommend a google search of something like "java draw animated gif" to get started.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Game Question

    Oh, nevermind that. Thanks! Also, is there any way to rotate an image with a custom pivot point? Let say I want the arm to rotate with its upper arm/corner as the pivot. If you get what I mean

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,972
    My Mood
    Hungover
    Thanks
    133
    Thanked 555 Times in 476 Posts

    Default Re: Java Game Question

    Quote Originally Posted by Francis115 View Post
    Oh, nevermind that. Thanks! Also, is there any way to rotate an image with a custom pivot point? Let say I want the arm to rotate with its upper arm/corner as the pivot. If you get what I mean
    If you're trying to get out of doing the basic trig, you're making it overly complicated. But again, I'd recommend a google search of something like "java rotate image" to get started. Then if you get stuck, you can post an SSCCE here that demonstrates your problem, and we can go from there.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Game Programming Question?
    By toofast88 in forum Android Development
    Replies: 1
    Last Post: March 21st, 2012, 07:34 AM
  2. Help with assignment about a board game (enum and array question)
    By Kranti1992 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 12th, 2012, 07:47 AM
  3. Newbie: general question on trying to get a simple Pokemon game to work
    By willmer in forum Object Oriented Programming
    Replies: 7
    Last Post: July 13th, 2011, 07:33 AM
  4. Guessing Game begginner question
    By okupa in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 20th, 2010, 07:31 AM
  5. Need help for my java game
    By blunderblitz in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 27th, 2010, 05:32 AM