Lab[1] = Make it Move

11/8 Update: Significant rework since last revision

Objective

  • Run the Jaalaga starting code on a device
  • Restrict the ships movement to only left and right movement
  • Find a ship speed that that is good for the game
  • Replace the ship sprite with a better graphic

What You Will Need

Lab Version

  • Version 0.5

Prerequisite

In Lab[0] we setup a development environment. Our development environment at this point includes several software tools, the AndEngine source code and our Android or Kindle Device. Among the code was a project with a wide variety of AndEngine examples. You should have reached a point where you ran these examples on your device. If you did not reach this point you should get Lab[0] working before tackling this lab because it requires a working AndEngine setup.

Introduction

In this lab we will start to build our game. As we discussed in class, we will be building a game that is similar to the arcade classic Galaga. We can’t use the same name so we will just call our game “Jaalaga”. In Jaalaga you will be piloting a space ship and trying to eliminate the hostile aliens. You ship is fixed to the bottom row of the screen. Your ship can move left and right and can fire two shots at any time. Enemies move in formation and periodically break formation to dive at your ship. All ships are destroyed when they are hit by a missile or collide with another ship. In this lab we will focus of the movement of just the player’s ship.

The images below display the two screens we will see:

Screenshot_2013-11-08-02-26-11    Screenshot_2013-11-08-02-25-50

Steps

Run the Starting Code for the Game

First you will need to get the starting code from Git Hub at the link described above. Add this project to your working setup from Lab[0].  Compile and run the code and you should see the screens above.

Examine TODO Items

The source code for this lab and future labs will be marked with comments that have TODO at the beginning. This lab has three such comments

lab_1_todo

  • JaalagaResourceManager.java (Line 208)
  • ManagedGameScene.java (Line 122)
  • ManagedGameScene.java (Line 56)

After reading the comments, make changes to the code based on each TODO item. You may have to look up help on AndEngine functions to change the right thing. Feel free to make a guess and verify if your assumptions were correct. When you have completed the three TODO items you have completed Lab[1].

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: