In this tutorial I will show you how easy to draw (character) sprite if you wanna make game in java programing language. First we gonna use JPanel as our game canvas, the idea is override and call logic method as you need inside of it, example :


Dragon Ball: Attack of the Saiyans
Learn more
 , spriteLocationY, (spriteLocationX+width), (spriteLocationY+height),x, y, (x+width), y+height,this);

Spliting Sprite


Arthur Spiderwick's Field Guide to the Fantastical World Around You (The Spiderwick Chronicles)
Learn more
Holly Black

There rest is decide the logic how to update or change location (spriteLocationX, spriteLocationY) of character in canvas and coordinate (x,y) split of picture based on character state change. Don't forget to repaint() root parent component each time character state changed event (variable  x, y, spriteLocationX,  sprite locationY, etc changed) to refresh the draw inside of your canvas (JPanel) , if you not then you wouldn't see any change. Short post but I hope useful  for anyone who want to make java game. Thanks for reading, don't hesitate to comment if you want to ask something or give any feedback.


For newest post about Java :

-6.891293 107.601214

Advertisement