Structure of Our Sample Engine:
ArrowGame.java -> Holds the Control. Listens to the Gestures from the screen and then calls methods from the View to update Actor Positions
Data Elements:
Private Instance of ArrowGameView arrowGameView
Instance of Gesture Detector
Private inner class of SimpleOnGestureListener
ArrowGameView.java -> Holds the View and the Game Logic Loop. Also Holds the “cast” of Actor instances that will take part in the Game.
Data Elements:
Public Instance of Actor archer
Public Instance of Actor arrow
Public Instance of Actor balloon
Private Handler h
Private constant int FRAME_RATE = 30
Actor.java -> This data structure will model the “characters” in the game.
Data Elements:
Private Context context
Private int x
Private int y
Private String name
Private int costume
Private int currentCostume
Private Array BitMapDrawable[] graphic
res/drawable:
These characters should be provided for download later.
archer.png
arrow.png
blueballoon.png
drwho.png
popballoon.png
tardis.png
activity_arrow_game.xml:
Holds the XML code that will control the layout of the View
ok Friends this was the android game engine for android OS tutorial hope you people like it. stay with us for next tutorial.
NOTE : Dear Readers if you have any query/question feel free to ask me via comment box given below. Also Follow us on social media site and share that post with your friends. - See more at: http://onlinecomputercafe.blogspot.com
useful tutorial keep it up...
EmoticonEmoticon