RSGameEngine Beta! - Game Development Easy!

XverhelstX

Well-Known Member
Licensed User
Longtime User
RootSoft's Game Engine Library Beta!

---------------------------------------------------------​

I. Introduction

I'm proud to introduce my beta version of my new RSGameEngine Library!

This library tries to make Game Development a lot EASIER with Basic4Android.

The library is completely written by myself with credits to thedesolatesoul and NJDude!

With only 50 lines of code I wrote a sample that controls an ANIMATED 3/4 view (zelda like) - character with a GUI.

Note that this is still an early beta version and might contains bugs!

---------------------------------------------------------​

II. Usage

The library is very easy to use and there are 6 classes available so far.

B4X:
Dim GameEngine As RSGameEngine
Dim GameConstants As RSGameConstants
Dim sprMain, sprLeft, sprUp, sprDown As RSGameSprite
Dim objMain As RSGameObject
Dim Effects As RSGameEffects
Dim GameAudio As RSGameAudio

1. RSGameEngine.
The RSGameEngine is the base engine of the class. This takes care of the DrawingPanel and objectplacing so far. Later it will support saving, loading, etc.
The DrawingPanel is the panel where your game is playing. Objects can be placed here. This is a normal panel that can be used in Basic4Android.

2. RSGameSprite.
Sprites are the images in a game. In the RSGameSprite class you can specify a spritesheet (1 row) in a bitmap. GameSprites have no actions, you can however get data like number of frames, get width, height, etc.

3. RSGameObject.
An RSGameObject is an object on the DrawingPanel. These can be placed on the panel with RSGameEngine.PlaceObject. GameObjects are deliverd in an ImageView. So you can set a bitmap in it, specify it's X and Y position and more variabeles and actions like levels, hitpoints, mirroring, flipping, .... (Note that the X and Y are like Top and Left of an imageview. These are NOT the centre of the Image but the top left corner.)

4. RSGameEffects.
GameEffects can be binded with GameObjects. Doing this you can easily control the Object like moving, animation, etc. Physics for platformer games will be added.

5. RSGameAudio.
RSGameAudio is the audio used in the game. Currently it only supports MediaPlayer, but SoundPool will be added in a next version. We recommend to use MediaPlayer for background music and Soundpool for sound effects.

6. RSGameConstants.
These are constants used in the game like FACING_LEFT, FACING_RIGHT. These can come in handy if you want to know where a charachter is facing at.

---------------------------------------------------------​

III. Library Files & Sample

The library files doesn't need ANY permission!
Download the zip file and extract the RSGameEngine.jar and RSGameEngine.xml to your additional library folder and check them in the library tab in the Basic4Android IDE.

A sample is included with a character than can walk. The code is commented so you can understand the code. The sample is designed for 854*480 screen resolutions! The sample is delivered with 1 audiofile and multiple sprite(sheets)! You cannot use them in commercial products! We are not responsable!

Download the sample here: http://www.rootsoftllc.com/Basic4Android/RSGameEngineSampleBeta1.0.zip
A more reliable sample is downloadable here: http://www.b4x.com/forum/additional...e-beta-game-development-easy-3.html#post94453

Library files are in the attachments of the forum.

---------------------------------------------------------​

IV. Spritesheets

The RSGameEngine supports single rows spritesheets.
I'm recommending GameMaker Standard(Lite version or Pro) or GraphicsGale to create your .png spritesheets.
With GameMaker you can easily add sprite, see the animation, extract a spritesheet and save them as a spritesheet to use in RSGameEngine Library.

---------------------------------------------------------​

V. Credits
Credits are NOT necessary, but it is allowed. If you do give credits, mention RootSoft - Mobile Application Development

---------------------------------------------------------​


Kind regards,
Tomas
 

Attachments

  • RSGameEngineLibraryBeta1.0.zip
    9.7 KB · Views: 870
Last edited:

PharCyDeD

Active Member
Licensed User
Longtime User
Ran through the demo app and noticed that he doesn't move well at the moment (on my Xoom at least). In order for him to fluently move I have to wiggle my finger over the direction I want him to go. Otherwise, he just stays static but moves (shows no walking animation but still moves). This will be an excellent library though!
 

ZeroSoft

Member
Licensed User
Longtime User
Great!! Finally a game engine for B4A.I will try it :sign0188:

same problem like PharCyDeD said. the sprite is moving but no animation i think the problem is in the B4A code not in the library
 
Last edited:

squaremation

Active Member
Licensed User
Longtime User
:sign0098:
OMG This is great! I have been thinking about a game that I'm going to try and implement this lib. I'm working on one now that if I can get the sprite animation to work correct is perfect. I'm going to fool around with it!
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
Ok, you should redownload the sample.
I used the GameConstants FACING now to determine the animation instead of ACTIVITY_TOUCH.

It should work now.

Tomas

EDIT: I'm recommending GameMaker Standard(Lite version or Pro) or GraphicsGale to create your .png spritesheets.
With GameMaker you can easily add sprite, see the animation, extract a spritesheet and save them as a spritesheet to use in RSGameEngine Library.
 
Last edited:

PaulR

Active Member
Licensed User
Longtime User
I've just downloaded this and thanks for the great work. :)

I too am experiencing the issue where only a new touch/movement on the virtual joypad triggers the events that move the sprite.

Is the code supposed to move the sprite until the joypad is released, or is it triggering on new/move events on the joypad?
 

PharCyDeD

Active Member
Licensed User
Longtime User
Still not functioning properly for me. I thought maybe it was a matter of the buttons being small, but I made them pretty big and it still doesn't run smoothly. The character stutters a lot when showing the walking animation. Sometimes he will take a few steps and then "floats" for like 5-10 steps. Again, all can be resolved if I slide my finger back and forth over the button of whatever direction I want to move. If I do that then it works flawlessly, but it doesn't really feel right ya know? Again I am using a Xoom Tablet running latest updates. My wife has a Droid 4 so I will test on her phone when she gets home if you want.
 

rbsoft

Active Member
Licensed User
Longtime User
Tried the GameEngine Sample an a Galaxy Tab. Works fine...

Rolf
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
Is the code supposed to move the sprite until the joypad is released, or is it triggering on new/move events on the joypad?

The code is supposed to move the GameObject until the joypad is released. The joypad calls MoveLeft/MoveRight, etc to move the object x/y position from it's original position.

Update is called when he is facing another direction to update his current spritesheet/animation.

PharCyded, did you tried the new sample?

Tomas
 

vb1992

Well-Known Member
Licensed User
Longtime User
If you move your finger around the right arrow button
like you are scratching off a lottery ticket then it seems
to work and the zelda man runs properly, but if you just
press down and hold it in one spot he stays still or inches
forward really slowly.
 

vb1992

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Panel1_Touch (Action As Int, X As Float, Y As Float)

   If Action=2 OR Action=0 Then
   p_x=X
   p_y=Y
   timer1.Enabled=True
   Else
   timer1.Enabled = False
   End If
   
End Sub

I think It's best to test for it, then have
a timer get enabled, and that timer1_tick
then does the movement of the sprite
 

PharCyDeD

Active Member
Licensed User
Longtime User
Yes, I used the new sample and the problem continued. I am not sure what, but something is going wrong in the animation cycle unless you rub the button.
 

alwaysbusy

Expert
Licensed User
Longtime User
GameEngine

Hi XverhelstX

I've also started working on a GameEngine a couple of months ago. It then resulted in the ABPhysicsEngine, but this was only the first part of the GameEngine. As this was a big project, I wanted to split up the lib in a pure physics engine and a second engine to do the graphics. The second part would contain sprites, a gamepad, animations, etc...

Due to other projects, I've never finished the second part but maybe some of it can help you with your engine.

Attached is what i could find back.

Cheers,

Alwaysbusy
 

Attachments

  • ABGameEngine.zip
    26.4 KB · Views: 337
Top