How To Draw Game Sprites
how to draw game sprites
Java Game Programming – Draw (Character) Sprite « Meihta Dwiguna Saputra's Knowledge Base
September 5, 2011
Java game, gundam, java, split, splitting, sprite, sprites
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 SaiyansLearn more
, spriteLocationY, (spriteLocationX+width), (spriteLocationY+height),x, y, (x+width), y+height,this);
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
0 コメント:
コメントを投稿