B4J Library SimpleGameEngine

This is a game framework for B4J that includes many features of advanced game frameworks like libGDX but is designed to be as simple to use as possible.
It can be used for games of course, but also for animations, slideshows, paint program, etc. It is more complete than the Canvas library.

This framework has been entirely written from scratch (except 20-30 lines taken from libGDX for the most technical parts of the tiled map reader). The Java source code is available against a donation of 10 euros or more.

Don't miss this game made with SGE (PacDroid, a Pacman clone):
https://www.b4x.com/android/forum/threads/pacdroid.78617/

Let me know if you are using this library for a real project. And, of course, feel free to post comments and suggestions.

Actors:
sgeActor
sgeGroup
sgeRootGroup

Audio:
sgeMusic
sgeSound

Automation:
sgeAction
sgeActions
sgeInterpolators

Camera:
sgeCamera

Drawing:
sgeGraphics

Effects:
sgeEffect...

Input:
sgeInput
sgeKeyEvent

Geometry:
sgeBoundingBox
sgeCircle
sgeIntersections
sgePoint2D
sgePolygon
sgeSegment
sgeSpline

Maps:
sgeMapCell
sgeMapTile
sgeMapTileset
sgeTiledMap
sgeTiledMapImageLayer
sgeTiledMapObject
sgeTiledMapObjectLayer
sgeTiledMapTileLayer

Navigation:
sgeNavigationGrid
sgeNavigatorAStar

Steering behaviors:
sgeBehavior
sgeBehaviorFollowPath
sgeBehaviors
sgeVehicle

Visual objects:
sgeAnimation
sgeNinePatch
sgePath
sgeRegion
sgeText

Miscellaneous:
sgeAssetManager
sgeScreen
sgeUtils

Current version : 1.61
Search tags: Simple Game Engine, jSimpleGameEngine
 

Attachments

  • SGE_examples1.zip
    203.3 KB · Views: 672
  • SGE_examples2.zip
    477.3 KB · Views: 503
  • SGE_examples3.zip
    423.6 KB · Views: 534
  • SimpleGameEngine161.zip
    216.9 KB · Views: 534
Last edited:

wonder

Expert
Licensed User
Longtime User
Awesome, thank you so much!! :) I'll have a look during this week.
 

Jaames

Active Member
Licensed User
Longtime User
No other words than, You are amazing ... Thanks a lot for sharing this.
I tried it on fairly old laptop and all examples run smooth as butter :)
 

sorex

Expert
Licensed User
Longtime User
works fine here aswell, good job.

the tilemap give this red error in the log > Unexpected event (missing RaiseSynchronousEvents): sge_start

but it works fine.
 

Informatix

Expert
Licensed User
Longtime User
works fine here aswell, good job.

the tilemap give this red error in the log > Unexpected event (missing RaiseSynchronousEvents): sge_start

but it works fine.
I never use the debug mode so I never see this kind of errors. Maybe someday I will understand where to put the RaiseSynchronousEvents annotations to get rid of these errors... In the meanwhile, ignore them or run in Release mode.
 

Informatix

Expert
Licensed User
Longtime User
Any method that is called from B4J and raises an event (with ba.raiseEvent or raiseEvent2) before the method returns should be tagged with this annotation.
I tried to add them this time but that does not work. Some of them are in the XML file of the library, some others not and thus are not taken into account. Don't know why. I don't know the version of my BADoclet. Its size: 18343 bytes and 962.
 

Informatix

Expert
Licensed User
Longtime User
Beta 0.5: new features (music, sound, object layers of tiled maps, isometric maps, hexagonal maps, interpolators, export/import of navigation grids, sgeUtils class, polylines), new demos, fixed bugs.

I don't plan to add new features for now. This beta version covers most needs for a game.

Let me know if you use it in a real project and, of course, feel free to post comments and suggestions.
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I did not understand. You can say? Code Speed?

I hope you reconsider because you seem to be a great expert in games and it would be nice to have a library easier than libgdx for b4a.

Ok, I See.
[Lib] Accelerated surface;)
 
Last edited:

ilan

Expert
Licensed User
Longtime User
thanks a lot, this is awesome.
now we have a Game Engine and Jbox2d (deadly mix)

how could i missed this thread o_O
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
It is probably not related to the doclet version. If you like send me the complete project and I'll try it here.
I found where was the problem. The methods raising events were in a hidden abstract class. I just moved the annotation to the public callers of these methods and that works fine in Debug mode.
These changes will be in the next beta version.
 

JanG

Member
Licensed User
Longtime User
Pretty cool! It works on the raspberry pi as well. Yes, with some modifications and problems (e.g. sound and keyboard input). But the PacDroid sample is running with moving ghosts/apples.

Thanks a lot!
 

Informatix

Expert
Licensed User
Longtime User
In case someone wonders, I confirm that SimpleGameEngine is not concerned by the animation issue under Windows reported by many Java users AS LONG AS you set the smoothness parameter to 10 or more when you initialize SGE. You can notice this problem by setting this parameter to 1 or by using the Canvas+Timer libraries for example.
This bug is well described since 2015 but it is still not fixed:
https://bugs.openjdk.java.net/browse/JDK-8136536
 
Top