Hey folks,

While working on my game engine, I have been working on an asteroids type game to address bugs and functionality issues. With a lot of help from Loginus when ever I get stuck, I have got it to a point where I am proud to show it off. The engine itself still has a lot of work needing done, but my next projects will help me get other things sorted

It has an infinite tiling paralax background, basic ship AI, black holes flying around and reacting with eachother using gravity(they also pull towards ships), and a score keeping system so you can compete with the other AI ship flying around with you. Have a jam and see how you go!

I didn't add any lose case when colliding with a black hole because I find it is fun to watch the physics interactions between the objects.


Have fun!

Wow how fast you write code!!

Add an object responsible for the UI to the engine.

In the right headspace it all falls together nicely. Where everything just makes sense. But that headspace can be hard to access at times.

Good idea, I think I got lazy at the end and rushed through it to get a menu working haha. I have been working on a GUI engine on the side which I plan to have functional windows, tabs, menu bars etc. New territory for me so wanted to experiment outside of the engine before implementing it. I think the hardest part will be if a few windows are layered on top of each other, getting it to register which window is at the forefront of being clicked. I know it will have something to do with an array of windows within the click position and iterating based on their depth, but ill attack that issue when it arrives

Uuuh, GUI engine :) Can't wait to see that one, too lazy to build my own, LOL

The simplest engine for UI.

  • everything is based on AABB collisions (with the mouse).

  • The topmost layer desktop > keeps a list of all windows (one application can have several windows). When the Desktop detects a mouse collision with a window, it sends a message to the application that it has a mouse collision and should handle this event.

  • application - receives a message and checks in which window it has collisions, sends a message to the window that it should handle the collision.

  • window layer - receives the message and detects whether the mouse has a collision with any element in the window. If so, it sends a message to this element.

This happens until the object that receives the message has no one to send information about the collision to (it has no children - e.g. it is a button) - then it reacts to the event.

You don't need to have a depth buffer either - because you just need a list of windows to draw and redraw the windows. When the user clicks on a window other than the one currently on top, simply move the window to the top of the list.

Well after a LOT of trial and error(due to screen translation), I have got windows working(consistently I hope).

I went the depth buffer route. Now to get containers working drawing an image from a background canvas and attatch a container to the windows to draw any buttons etc.


I figure I dont need to add mouse press events as in the API resource it says touch events trigger mouse events.

Let me know what you think so far.

Post a reply



Validate your e-mail address to participate in the community