Games Multi Arcade Game (WIP)

melonZgz

Active Member
Licensed User
Longtime User
Totally understand. I've been thinking about this myself lately. It's great to have something simple available like libgdx b4a library to use for free. But it's not officially supported and could stop working any moment like you say. I've been tempted to look elsewhere but haven't looked much so am not sure what else I could use that would be as simple.
I have 2 big games in production (this one and the bubble one, and not forgettin the Hill Racing one and it's updates), but after these ones I'll try another engine. I've been searching and I find Godot a very good way of making games.
Back on topic, I've done some progress on a 1D pacman game:


(it's a copy/ inspired on this)
 

melonZgz

Active Member
Licensed User
Longtime User
And here comes the racing game:


The concept is simple, as you progress the velocity increases and also does the traffic.
There will be different stages (not shown in the video) and more animations, particles and stuff like that
Now I'd like to take an approach to the shooter game, I think it will be the most difficult one...
 

andymc

Well-Known Member
Licensed User
Longtime User
I'd love to see a write up on how you handle the code layout for this type of game. Are the game in separate modules, or just different gameloops within one big file? Are you still using box2d for collisions and basic physics?
 

melonZgz

Active Member
Licensed User
Longtime User
I'd love to see a write up on how you handle the code layout for this type of game. Are the game in separate modules, or just different gameloops within one big file? Are you still using box2d for collisions and basic physics?
Usually I use A LOT of classes. ie, for the pinball I have one for the ball, for the flipper, for the bumper, for the sensor...
What I've done here is a main class, and I have in globals:

globals:
Dim lGdx As LibGDX
Dim GL As lgGL   
...   
Dim pinball As cPINBALL
Dim basket As cBASKET
Dim flappy As cFLAPPY
...
Dim IP As lgInputProcessor   
Dim GD As lgGestureDetector

I have a cPINBALL class where I do everything related to the pinball (from input processing to rendering and physics, wich are box2D physics), another for the basket, and another for each game.
For the input processing I have something like this in main:

input in main:
Sub IP_TouchDown(screenX As Int, screenY As Int, Pointer As Int) As Boolean
    controlGUI.IP_TouchDown(screenX, screenY, Pointer)   
    If drawPinball Then
        pinball.IP_TouchDown(screenX, screenY, Pointer)
    Else if drawbasket Then
        basket.IP_TouchDown(screenX, screenY, Pointer)       
    Else if drawFlappy Then
    ...
End Sub

The same for the rest of events. And inside pinball I have this event, wich handles all the logic for the pinball game:

B4X:
Sub IP_TouchDown(screenX As Int, screenY As Int, Pointer As Int) As Boolean      
...
End Sub

For the rendering, almost the same, from main I call
B4X:
Sub LG_Render   
    'Clears the screen
    GL.glClearColor(0.8, 0.8, 0.8, 1)
    GL.glClear(GL.GL10_COLOR_BUFFER_BIT)

    Dim deltatime As Float

    ...
    deltatime = lGdx.Graphics.deltatime   
    If drawPinball Then
        pinball.render(deltatime)   
    ...

And inside the pinball render event I do all the drawings and updates

Almost the same for the physics
Inside my cPINBALL class I have a World object

B4X:
    Dim World As lgBox2DWorld

And inside the initialize event for the cPINBALL class I have

B4X:
    Dim vGravity As lgMathVector2
    World.Initialize(vGravity.set(0, -2), True, "Box2D")

And the events are inside this class

B4X:
Sub Box2D_BeginContact(Contact As lgBox2DContact)

Sub Box2D_PreSolve(Contact As lgBox2DContact, OldManifold As lgBox2DManifold)

Sub Box2D_PostSolve(Contact As lgBox2DContact, Impulse As lgBox2DContactImpulse)

And the events are raised automatically (I mean, I dont have these events in main)
 

melonZgz

Active Member
Licensed User
Longtime User
Well, it's maybe too soon to show this, as this needs still A LOT of work, but I got excited as everything went better than expected and I've been able to make an approach to a shooter game in just 2 days and I feel very proud of it :)


I still have to add powerups and increasing difficulty, but it's a start and it's allready enjoyable.
From this point on, I guess that the fun part (or at least the creative part) is over. Now it's time to polish everything, adjust the difficulty curve of each game, add music and various effects, find a way to progress in the game to unlock things... so I guess this will be the last progress shown in a long time.
 

melonZgz

Active Member
Licensed User
Longtime User
Yes, I know I said that the shooter game was going to be the last one, but I couldn't resist to make just one more game, some kind of platformer game:
So, say hello to "Jumpy"


Simple concept. just jump over the levels and avoid the obstacles. everytime harder os you progress. I find it fun and addictive...
 

melonZgz

Active Member
Licensed User
Longtime User
Looking really good! When are you releasing the first version? Will you have a beta release track with new unreleased games in it? What about a premium add on to allow for extra features?
At the moment what I want to do is first stop adding more games 😅
Seriously now, the first thing is, at least for the arcade side, polish all the games. Check all the bugs and get everything ready. Add sounds and music, extra effects (shadows, particles, extra effects, etc). Adjust for all kind of screens (right now it doesn't look good on tablets, everything is out of adjustment).
BTW Now I'm getting the first big doubt, is if I should separate it into several applications or keep it all together (pinball by itself could be a standalone game, for example).
Anyway, when I get everything working well I would like to release a test version (beta, alpha or whatever). Then, when everything works well I will have to look at how to make it so that at the beginning almost everything is locked and you have to unlock things (so we get incentives for the player to keep playing).
 
Top