B4J Tutorial GameView - Simple Sprites Engine

This is a port of B4A GameView library and modules.

If you are not familiar with it then start with these tutorials:
https://www.b4x.com/android/forum/threads/20038/#content
https://www.b4x.com/android/forum/threads/20075/#content

GameView is implemented as a Class module. It is included in the attached example.
It depends on a library named jGameViewHelper. This library is also attached.

The attached example is a port of B4A asteroids game example (make sure to change the video settings to HD):


jGameViewHelper includes the following features:
- Low latency playback (LoadAudioClip / PlayAudioClip)
- DrawImageRotateAndFlipped - Allows drawing rotated and flipped images.
- AddKeyListener - Adds a key listener to the form and allows handling the key events before they are processed by other controls.
- SetBoxBlur - This method should improve the smoothness of Canvas drawings.

You can run it in debug mode however it will be very jumpy. The performance should be good in release mode.

The compiled executable jar file is available here www.b4x.com/b4j/files/Asteroids.jar (Requires Java 8)
 

Attachments

  • jGameViewHelper.zip
    5.6 KB · Views: 1,356
  • Asteroids.zip
    244.3 KB · Views: 1,325
Last edited:

wonder

Expert
Licensed User
Longtime User
Thank you, thank you and thank you again!!! This is a great addition to B4J!! :D
 
Last edited:

ilan

Expert
Licensed User
Longtime User
this is awesome... now we need something like this for B4i.. :D

thank you very much erel, really great work!

(@Erel i have the filling you should enlarge your server ;), i am in GM {Game Making} mood)
 
Last edited:
Top