[Beta] RSAndEngine - Beta testers/Sample writers needed

XverhelstX

Well-Known Member
Licensed User
Longtime User
logo.png

(Image belongs to Nicolas Gramlich)


It's almost here!
AndEngine for Basic4Android.

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!

f3uzqr4.png


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:

susu

Well-Known Member
Licensed User
Longtime User
Hi Tomas,

Your sample app got forced close on my LG Optimus G Pro phone (Android 4.1.2).
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
Hey Tomas,

This is really awesome. Please "sign me up" too for beta test.

What version of B4A does this need at the minimum by the way?

Thanks!

Check your inbox.
I'm not sure. It should be supported since version 2.0 (?). The version where the loading of external resources was fixed during compiling.

Hi,
I'd like to try it, too.

Patrick
Check your inbox.

Hi Tomas,

Your sample app got forced close on my LG Optimus G Pro phone (Android 4.1.2).

Are there any error messages?
Do you have any other phone to test it on?
Is it possible to check out the (unfiltered) log file and post it here.

Regards,
Tomas
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
I want to be a tester

Pm'ed.

Next version of RSAndEngine will contain:
- Bug fixes
- BaseGameActivity instead of SimpleBaseGameActivity. This fix will improve the loading of resources and the creation of scenes.
- Sound & Audio
- ZoomCamera
- ContinousHoldDetector - To determine long clicks, etc

Regards,
Tomas
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
New beta version of RSAndEngine is available!

You can find the new zip file in the same link I have sent the beta testers.

- Bug fixes

- BaseGameActivity instead of SimpleBaseGameActivity. This fix will improve the loading of resources and the creation of scenes. This is a lot better for the activity life cycle of the AndEngine Activity.

In the zip file there are 2 project files:
- SimpleGame: using a SimpleBaseGameActivity
- BaseGame: Using a BaseGameActivity <-- Latest development

All changes will be made to BaseGame as it's more advanced.

B4X:
' ! --------------- ! ANDENGINE EVENTS ! -------------- !

'The engine options are created
Sub AndEngine_EngineOptionsCreated (Options As Object)

End Sub

'Here you should load all of your sprites, backgrounds, tiles into memory.
Sub AndEngine_LoadResources

   'After the resources are loaded, we need to call this method in order to proceed
   AndEngine.LoadResourcesFinished

End Sub

'We create the scene.
'Here you have to handle all the scene stuff.
'Adding of sprites and entities should be done in _PopulateScene
Sub AndEngine_CreateScene

   'When you are done creating the scene, we need to call this method in order to proceed to _PopulateScene
   AndEngine.CreateSceneFinished(Scene)
   
End Sub

'Here we will populate the scene will different entities. 
'This could be anything from adding enemies to our scene, adding a player, playing music, setup menu options, 
'or pretty much anything else you can think of.
Sub AndEngine_PopulateScene (S As Object)

   
   'When you are done populating the scene, we need to call this method in order to proceed and let the engine run.
   AndEngine.PopulateSceneFinished

End Sub

'The Engine has stopped.
Sub AndEngine_Stopped

End Sub

- Sound & Audio

B4X:
Dim Music As AndMusic
Music.Initialize("MainTheme", "maintheme.mp3")
Music.Play

- ZoomCamera & SmoothCamera have been added.
This will make it easy to zoom in and out or smoothly go to a location instead of hopping the camera.

- TouchDetector - To determine touches.
Events:
* _HoldStarted(PointerId as int, holdX as float, holdY as float)
* _Hold (Time as long, PointerId as int, holdX as float, holdY as float)
* _HoldFinished (Time as long, PointerId as int, holdX as float, holdY as float)


Still looking for sample writers.

Regards,
Tomas
 

ssg

Well-Known Member
Licensed User
Longtime User
Hey Tomas,

Nice update.

I'm having an issue though, declaring a variable as "AndMusic" is throwing an error (red font in B4A and can't compile). AndMusic reference is not found. Am I missing a step?

Thanks!
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
Hey Tomas,

Nice update.

I'm having an issue though, declaring a variable as "AndMusic" is throwing an error (red font in B4A and can't compile). AndMusic reference is not found. Am I missing a step?

Thanks!

Hi

My apologies.
I forgot to update the library files in the zip file.
It's fixed now. Please download the zip file again.

Regards,
Tomas
 

Omar

Member
Licensed User
Longtime User
Hey Tomas,

I'd like to give it a try also if you could send me the link. Thanks.
 

walterf25

Expert
Licensed User
Longtime User
AndEngine

Oh my God X, i have been waiting for this day, i started playing with it a while back and was able to make some really great wallpapers, but i stopped because it was a little too difficult for me, count me in if you'd like me to test also, oh my God this is so exciting, Great Job x.

Cheers,
Walter
 
Top