Software Graduation Project Bundle Of Android Games Faculty of Engineering An-Najah National university Component of Computer Course
Outline Introduction Background Theory Methods & Techniques The Software AndEngine Physics AndEngine Box-2d
Project Idea Bundle OF “Android Games” Based on Box-2d Physics Engine
Why Android Games ??! Main motivations: Games are the killer applications for Smartphone’s today. mobile games very profitable business. Open Source.
Methodology Corona SDK BUT the money problem in this library
COCOS-2D Methodology BUT Mainly used in iOS, we didn’t find much information
Methodology AndEngine 2D Games Engine. Developed by “Nicolas Gramlich”. We could write our own functions in Java, using the Android APIs to implement the components of a game. AndEngine is a game engine library that makes it easier to write two-dimensional games for Android devices. Nicolas Gramlich led the effort to create AndEngine and wrote much of its code. The project is open source, so you are encouraged to go to the project website and join in the development effort for AndEngine. We could write our own functions in Java, using the Android APIs to implement the components of a game. AndEngine comes as a .jar file http://www.andengine.org/
Why AndEngine ?? Free, No money. Support Physics Engine (Box-2d Extensions). Support Multiple Touch Extensions. Support multiple Android SDK’s. muna
BUT There is two versions from AndEngine GLES 1 GLES 2 And a lot of JAR files are found, but not all of them compatible with “AndEngine Physics Box 2D Extensions” and the Android SDK version. muna
How to start ?? Classic Eclipse Android SDK Android SDK Tools ADT Plugins for Eclipse Oracle/Sun Java Development Kit ( JDK). AndEngine .JAR files & Physics Box-2D Extensions. These are the main program and the main tools the main jar files and SDKs that we ussed in our project
Problems during coding We were not Familiar with android. Many problems with Eclips and Emulator (stop Warking, delete the program and it take long time to start ).
AndEngine Game Concepts Texture Camera Base Game Activity Texture Region Scene Menus Sprite Entity
Physics Engine collection of effects that mimic the physics of the real world. simulates the physics of objects to give them believable real-life movement. Box2D is written in C++, but has been ported to many different languages by the user community. Although it can be used for other applications, the project was born primarily as a library for use in games, and games make up the majority of software using Box2D. The engine is written and maintained by one Erin Catto
Why Physics??? 1- It is used to realistically simulate the interaction of physical objects in the following: Simulation of the physics of rigid bodies Stable stacking Gravity 2- We generally won’t need physics if we are developing a bored game.
Box2d Physics Engine Units Rigid Body World Sensor Shape
Setting up Box2D The pattern for building a physics world and starting the simulation includes the following steps: Create a PhysicsWorld Create the static objects in the simulation, which might include a floor, some walls. Attach the shapes to the AndEngine Scene so they will be displayed.
Cont, 4. Connect the Sprites to the Physics with PhysicsConnectors. 5. Register the Box2D PhysicsWorld as an UpdateHandler for our Scene, so it can update Sprite positions.
After a month and a half
Game Components Opening (Splash) Screen Menu Screen Scene Music Time Levels Obstacles
Games Ideas It’s very difficult to predict which games will be hits, but a quick scan of Android Market shows that hundreds of thousands of users have downloaded certain games.
So, What ??? When we think of Game, We need it : Funny Profitable Used Physics in it. Scalable.
So, We decide to build
1- Bubble Shooter Game Idea fire a bubble and try to hit at least two touching bubbles of the same color to burst them.
3 Worlds (Levels)
Another Scene
GameOver
Problems Problem 1: direction of the ball released. Solution: We have traced the equations of motion to determine the right direction take the initial place of ball and take the position of mouse where it touched the screen of the emulator then and according to this coordination we give the ball linear velocity.
Problems Problem 2: Color detection of bubbles that should be burst after shooting the ball. Solution : This problem not resolved 100%
Another Problems Descent of bubbles for a specific distance and a certain period of time. Detect the scene if empty to go to win page.
2- Shoot Game Game Idea It is based on the principle straighten the ball on the goal and dropping it, like famous Angry Birds game. To play this game you have to pull the ball strongly by certain distance that you want to reach and the angle at which you will throw out. If you drop all the targets will pass the stage, you can try 3 times
3 Levels
Problems Main problem How to shoot the projectile in the correct direction with correct angle based on amount of tensile played by the player and also the direction in which he wants during the checkout process.
Solution We need to do equations, and these equations based on the initial position and the final one when we pull the ball on the scene. - Action Move - Action Up
3-Billiard Game Game Idea focus a stick on a white ball in a specific angle to shoot the ball in a given force that chosen by user then this ball will collides with the other colored balls. It is simply a billiard game, the idea of this game is to focus a stick on a white ball in a specific angle to shoot the ball in a given force that chosen by user then this ball will collides with the other colored balls that ordered on the table in a triangle shape and this leads to move balls in random directions. The aim is fall the colored balls in the holes of table and you must leave the black ball for last. If the white ball falls in the hole it will give foul and the level will be loaded again. The game contains three levels, then in next levels the number of colored balls will increased in addition to black one.
Level 1 the first level consist of just black ball and this should be dropped in any hole using the white ball and the stick
Level 2 then in next levels the number of colored balls will increased in addition to black one.
FOUL
Problems Problem 1 How do we make the stick move by the movement of the finger remains constant head toward the white ball ??!
Solution : “RevoluteJoint” it takes two bodies and a connection line between them, the first body will rotate around the second body and the two ends of the connection line attached to the centers of these two bodies.
Problem 2 The detection if a ball is matched a hole in order to drop it and delete it from balls Solution : We use hidden bodies in the holes and detect collisions.
Problem 3 When we need to shoot the ball after the first time, we need to detect if it’s velocity = 0, to re-shoot it another time, so we need to recreate the connection line (stick) near the white ball.
We change the ball body : Solution : We change the ball body : AngularDamping LinearDamping Torque Then we estimate the time based on this setting values.
Problem 4 We need to detect that the last ball is black, so every shoot we check the balls color dropped in the holes. Solution : We make a sensor to detect that and count the remains balls.
4- AndEngine & Box2d Simple application It is a simple application that contains of some features of Box2d integrated with AndEngine to show the effect of physics engine on a certain bodies.
snapshots
Accelometer
Animations
Mass
Pendulum
Features User friendly: games can be played by any user easily and it is suitable for all ages Availability: games are available any time. Any time users like to play he installs it from Play store.
Features Portable and Platform: there are able to run on any device use android operating system like series of Samsung, HTC, LG phones.
Future Work In future we can develop these games to have more features and function. Adding more levels and more work on GUI and Could become in the future global games.
Testing For testing games we firstly use android Emulator but this was inefficient, So we had to install the driver for Samsung Galaxy S2 and use it for debugging and testing.
DEMO Finally.
THANK YOU