Android game development

    Rokon game engine
Who am I

Daniele Montagni
Java developer, Android enthusiast
http://twitter.com/dmontagni

http://www.jugroma.it
What we’ve done
Gameset:
Tankattack is a turn-based strategy game. The setting is a fixed map and player can
control 2 tanks each game:




Goal of the game:
win the match by destroying all against player's tanks
How...

    Architecture and frameworks:
    • Android platform: 1.6 (2.3)
    • Rokon game engine: 1.1.1 (2.0.3)
    • Smack libraries: 3.1.0
    Tools:
    • Android SDK for Mac: 2.1-r5 (r8)
    • Netbeans: 6.8 (IntelliJ 10 CE)
    • Android plugin for netbeans
SDK Tools
Create your emulator through Android SDK and AVD manager
daniele@Daniele-Montagnis-MacBook~/android-sdk-mac_86/tools$./android 
Starting Android SDK and AVD Manager...
Easy project setup
  Create "android" type project into Netbeans




That has this structure




                                                ...than click "Run" project
Emulator & adb
                      This will run the
                      emulator and deploy




logcat through Netbeans show status:
Rokon
Rokon basics
public class TankAttack extends RokonActivity {
public void onCreate() { 
   createEngine(480, 320, true); 
}
public void onLoad() {
   ...
   Background background = new TileTextureBackground(atlas,
tileloader.getLayers());
   ...
   Sprite tank = new Sprite(80, 180, spriteTexture);
   Hotspot hotspotTank = new Hotspot(tank, 1);
}
public void onEvent(GameEvent event) {
   rokon.addSprite(tank);
   rokon.addHotspot(hotspotRedTank1);
}
public void onLoadComplete() {
   rokon.setBackground(background);
   rokon.addSprite(tank);
}
Smack
Smack basics:
ConnectionConfiguration connConfig = new
ConnectionConfiguration(host, port, service);
XMPPConnection connection = new XMPPConnection(connConfig);
connection.login(username, password);

Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
xmppClient.setConnection(connection);

Message msg = new Message(to, Message.Type.chat);
msg.setBody(text);
connection.sendPacket(msg);

     Type                     Format                     Sample
     START        START:[ROOM_ID]:[PLAYER_NUMBER]     START:234523:1
     MOVE              1:[XX]:[YY]:[ROTATION]             1:3:7:4
     SHOOT          2:[SENDER]:[TARGET]:[DAMAGE]         2:1:3:500
    ACK TRUE              TRUE:[TANK_ID]                 TRUE:2
    END GAME    END:[ROOM_ID]:[PLAYER_LOSER_NUMBER]   END:234523:1
Tips & Tricks
• Rokon is under development: things must be
 done from scratch!
 (ex. TileTextureBackground...)

• Android plugin for Netbeans is not stable
 (build.xml must be modified...)

• For rapid development use Eclipse that is
 supported by Android community:
 http://developer.android.com/sdk/eclipse-adt.html#installing
 ...or IntelliJ Idea 10CE
What’s new?
Game engine             IDE

                              +
How’s going our baby?
         June 2010




        January 2011
...and his toys?
Android market
                            Free vs. Paid




 1 year          6 months
Links
• Android SDK:
  http://developer.android.com/sdk/index.html

• Rokon:
  http://code.google.com/p/rokon/

• Smack xmpp:
  http://www.igniterealtime.org/projects/smack

• Netbeans plugin: (old)
  http://kenai.com/projects/nbandroid/pages/Install

• Google App Inventor:
  http://appinventor.googlelabs.com/about/
Thank you


                 ...
            B ye

Android game development

  • 1.
    Android game development Rokon game engine
  • 2.
    Who am I DanieleMontagni Java developer, Android enthusiast http://twitter.com/dmontagni http://www.jugroma.it
  • 3.
    What we’ve done Gameset: Tankattackis a turn-based strategy game. The setting is a fixed map and player can control 2 tanks each game: Goal of the game: win the match by destroying all against player's tanks
  • 4.
    How... Architecture and frameworks: • Android platform: 1.6 (2.3) • Rokon game engine: 1.1.1 (2.0.3) • Smack libraries: 3.1.0 Tools: • Android SDK for Mac: 2.1-r5 (r8) • Netbeans: 6.8 (IntelliJ 10 CE) • Android plugin for netbeans
  • 5.
    SDK Tools Create youremulator through Android SDK and AVD manager daniele@Daniele-Montagnis-MacBook~/android-sdk-mac_86/tools$./android  Starting Android SDK and AVD Manager...
  • 6.
    Easy project setup Create "android" type project into Netbeans That has this structure ...than click "Run" project
  • 7.
    Emulator & adb This will run the emulator and deploy logcat through Netbeans show status:
  • 8.
    Rokon Rokon basics public classTankAttack extends RokonActivity { public void onCreate() {     createEngine(480, 320, true);  } public void onLoad() {    ...    Background background = new TileTextureBackground(atlas, tileloader.getLayers());    ...    Sprite tank = new Sprite(80, 180, spriteTexture); Hotspot hotspotTank = new Hotspot(tank, 1); } public void onEvent(GameEvent event) { rokon.addSprite(tank); rokon.addHotspot(hotspotRedTank1); } public void onLoadComplete() {    rokon.setBackground(background);    rokon.addSprite(tank); }
  • 9.
    Smack Smack basics: ConnectionConfiguration connConfig= new ConnectionConfiguration(host, port, service); XMPPConnection connection = new XMPPConnection(connConfig); connection.login(username, password); Presence presence = new Presence(Presence.Type.available); connection.sendPacket(presence); xmppClient.setConnection(connection); Message msg = new Message(to, Message.Type.chat); msg.setBody(text); connection.sendPacket(msg); Type Format Sample START START:[ROOM_ID]:[PLAYER_NUMBER] START:234523:1 MOVE 1:[XX]:[YY]:[ROTATION] 1:3:7:4 SHOOT 2:[SENDER]:[TARGET]:[DAMAGE] 2:1:3:500 ACK TRUE TRUE:[TANK_ID] TRUE:2 END GAME END:[ROOM_ID]:[PLAYER_LOSER_NUMBER] END:234523:1
  • 10.
    Tips & Tricks •Rokon is under development: things must be done from scratch! (ex. TileTextureBackground...) • Android plugin for Netbeans is not stable (build.xml must be modified...) • For rapid development use Eclipse that is supported by Android community: http://developer.android.com/sdk/eclipse-adt.html#installing ...or IntelliJ Idea 10CE
  • 11.
  • 12.
    How’s going ourbaby? June 2010 January 2011
  • 13.
    ...and his toys? Androidmarket Free vs. Paid 1 year 6 months
  • 14.
    Links • Android SDK: http://developer.android.com/sdk/index.html • Rokon: http://code.google.com/p/rokon/ • Smack xmpp: http://www.igniterealtime.org/projects/smack • Netbeans plugin: (old) http://kenai.com/projects/nbandroid/pages/Install • Google App Inventor: http://appinventor.googlelabs.com/about/
  • 15.
    Thank you ... B ye