Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a simple 2D game for Android? [closed]

I'm a complete newbie when it comes to game development and I need someone to point me to the right direction.
For the sake of clarity please consider the following animation. simple zombie game animation

Basically I need to know how to emulate the above animation as an Android game but I don't know the steps necessary to do as such. My questions can be summarized as follow:

  • Do I need to use a Game Engine for such simple games?
  • Or it can be done without the use of any particular framework?
  • Do I need to use an animation application such as Adobe Flash?
  • What are the necessary steps to make this kind of game?
like image 375
2hamed Avatar asked Apr 24 '14 16:04

2hamed


People also ask

Can you make a 2D game on Android?

If you don't have programming knowledge, then you must know about Construct 2. This is a simple platform for 2D games, the best application of its kind, which occupies a leading position in the market. The main advantage is the ability to create games on almost all platforms, including Android.


2 Answers

Using a game engine or not is a preference. It will depend on what exactly you are after. If you want to learn about the underlying concepts of rendering, collision detection, etc, then writing these yourself is perfectly acceptable, and a lot of fun. On the other hand, if you just want to get the game done without having to worry about the details then an engine is definitely the way to go.

Game engines range from very basic wrappers (which usually provides easier functions that take care of low level tasks) to highly complex abstractions in which the actual game development no longer resembles any specific platform - they also sometimes allow you to create the game once and deploy it to various platforms without any changes.

To implement a game based on that animation you might use the following:

  • For each non-player character create a series of consecutive "frames" which when cycled gives the illusion of movement. These can be created in any graphics application (preferably in a texture map/atlas).
  • For the player character, you will need an animated sequence for each "move", such as kick, punch, etc. Then play the correct sequence when the player triggers some action (ex. play the kick sequence when the player pushes a kick button).
  • Each character should have a bounding box (i.e. a rectangle that defines the size and position of the character). The player character should probably have a different sized box based on the type of attack (i.e. the box for the kick action would extend farther to the right than the box for the punch action.
  • Randomly spawn characters at the right of the screen and move them at some speed (based on type?) towards the player. During each iteration, test for collisions between the player and each non-player's bounding boxes. If a collision is found, check if the player is kicking or punching and kill the character that was hit, if the player is not attacking maybe damage him/her.

That is a very basic description of your problem and should give you enough ideas to research in order to implement a basic version :)

Some game engines you might want to look into:

  • Andengine
  • LibGDX
  • Unity

If you are interested in learning about making android games specifically, have a look at this book:

  • Beginning Android Games
like image 147
free3dom Avatar answered Oct 09 '22 13:10

free3dom


There are many game engines out there that can help you can get the job done.

Here is a link for all the mobile game engines out there.


Android 2D Game Engines

Cocos2D-x

Language: C++

Orientation: 2D

Difficulty: Intermediate


Corona SDK

Language: Lua

Orientation: 2D/3D

Difficulty: Intermediate


EDGELIB

Language: C++

Orientation: 2D

Difficulty: Intermediate


GameMaker

Language: None (Graphical)

Orientation: 2D

Difficulty: Easy


GameSalad

Language: None (Graphical)

Orientation: 2D

Difficulty: Easy


HaxeFlixel

Language: Haxe

Orientation: 2D

Difficulty: Intermediate


libGDX

Language: Java

Orientation: 2D/3D

Difficulty: Intermediate


Marmalade

Language: C++

Orientation: 2D/3D

Difficulty: Intermediate


Stencyl

Language: ActionScript (optional), Objective-C (optional)

Orientation: 2D

Difficulty: Intermediate


Unity3D

Language: JavaScript (UnityScript actually), C# (Mono)

Orientation: 2D/3D

Difficulty: Intermediate

like image 24
atlassium Avatar answered Oct 09 '22 11:10

atlassium