AndEngine is a set of libraries, made by Nicolas Gramlich, made to program 2D videogames for android devices through the OpenGL ES 2.0 technology. It is easy to use, has multiple features and is open source!
So far we have:
- Engine
- EngineOptions
- Constants
- Scenes
- Collision
- Sprites (Normal, Animated, Tiled)
- Background (Normal, Parallax)
- Camera (Normal, Bound)
- Text
- Font
- HUD (Heads-up Display)
- ...
Basically we have most of the stuff (except for the physics part) to make a decent 2d game.
Using AndEngine is Basic4Android is a lot more easier then doing it in Eclipse.
With just a couple of lines, you can load a sprite and show it on the screen.
Loading the engine
B4X:
'Loads the AndEngine
Sub LoadEngine
'First we need a Camera Object
'A Camera object is seen as the view of the game. This will define what you see in game on your screen.
Camera.Initialize(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT)
'Now we initialize the Engine Options needed for the Engine.
EngineOptions.Initialize(True, True, EngineOptions.LANDSCAPE_FIXED, Camera)
'Next we will create a scene
'A scene is the object where we will draw on. See like a canvas
Scene.Initialize("Scene")
'And let's initialize the engine.
AndEngine.Initialize("AndEngine", EngineOptions)
AndEngine.Scene = Scene
'Starts the game
AndEngine.StartGame
End Sub
Player character
B4X:
Dim Player As AndAnimatedSprite
Player.Initialize("Player", "player.png", 0, 0, 96, 32, 3, 1)
Scene.AttachChild(Player)
Player.Animate( Array As Long(100, 100, 100))
Collision detection
B4X:
Sub sprTower_ManagedUpdate (SecondsElapsed As Float)
If Player.CollidesWith(sprTower(0)) Then
Text.Text = "Player collided with the first tower."
Else If Player.CollidesWith(sprTower(1)) Then
Text.Text = "Player collided with the second tower."
Else If Player.CollidesWith(sprTower(2)) Then
Text.Text = "Player collided with the third tower."
End If
End Sub
Beta testers/Sample writers
Now i'm looking for some beta testers/sample writers to test out AndEngine.
If you want to be a beta tester/sample writer, please reply to this topic.
I will select a few beta testers and sample writers who can test out RSAndEngine.
You should report bugs, suggestions, new features, ... here on this topic.
Documentation
Information about the core terminology can be found here:
https://www.dropbox.com/s/7tbjjr9jhq9chrw/Documentation.pdf
Note that AndEngine is poorly documented. I tried my best to document all methods, but there are still a few methods without explanation, etc.
You can also provide information for methods on this topic or edit the document.
Sample
Attached is a small example of AndEngine written with Basic4Android.
It's fairly basic but it shows a couple of features like text, font, scenes, collision, touch areas, animation, etc
https://www.dropbox.com/s/e5icnzjgsyoijlg/RSAndEngine.apk?m
Kind Regards,
Tomas
Last edited: