• Post Reply Bookmark Topic Watch Topic
  • New Topic

game animation ( 2d )

 
Rich Stepanski
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dont know a lot about the subject, anyone have any info about...

ways to draw a game background?

ways to scroll / update background?

ways to draw characters onto background?

I've been playing around with a JFrame. I've been able to read a 2-dimensional array of 1s and 0s and then draw one image or another onto the JFrame. That makes the background. I can put that into a thread to keep the background updating. Scrolling and character drawing have stumped me.

Would I need to keep track of how much to offset the background, and repaint it at a different position ?

Thanks, sorry for the vagueness.
 
Aaron Roberts
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are trying to make some type of RPG where you wander around. If, so then you don't need a seperate thread, unless you want things to animate when the user isn't doing anything - ie stars blink or water to move etc.

Whats your overall goal? That will determine alot about how you set things up. Some different architectures could be -

- No threads, event driven based on user input
- Animation thread, event driven based on ....
- Timer based for computer / simulation thinking, turn based or not
- Main animation thread for animations and inputs

They are all pretty different and bring different types of issues with them.

HTH,
Aaron R>
 
Ruben Steins
Greenhorn
Posts: 15
Chrome IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this free online book on Java Game programming techniques, which covers all of your questions (and many more)
 
Rich Stepanski
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaron - I was thinking about trying a Mario rip actually. Just something to play with. I'm not familiar with game/animation programming at all.

Ruben - thanks for the link, That helps.

Thanks both of you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!