This runs at 60 fps locked (no delta time used), and the way it works is that the ball does a forward trajectory scan and predict its precise path and collisions. The physics system of game maker isn't used (no fixtures etc...). It does use the build in variables like gravity. Because of this, the algoritm I came up with is a little complex, but building a table becomes fairly simple.
The downside, for now, is that multiball collisions are not perfect, so I excluded them from the latest version. I need to find a good amount of time before I can solve that difficult problem (I will get back to this template eventually).
As for 1 ball pinball games, I think it works rather well at a variety of ball speeds.
I made this because I wanted to experiment with simply drawing collision mask shapes in Aseprite, then import them, and have them work instantly without the need to apply very complex physics fixtures.
Not perfect, but I would say a nice alternative to handle pinball in Game Maker Studio with room to expand upon it.
I would say the big thing about this template is the ability to simply draw any (realistic) shape for collisions, and have it simply work when it comes to normal vectors and collision reflection vectors.
Hi!
This does not have a random level generator in it. What this does is convert layer tilemaps into 3D mazes, and use 3D billboard sprites for the items and enemies you place as instances in the room editor.
However, if you can code logical randomized tilemaps yourself, the conversion to 3D would apply as well.
A room is constructed mostly through 4 layers: Floor, Walls, Ceiling and "Wall pieces above doors". When you draw these layers in the room editor, these will be converted into the 3D maze. If you can figure out a way to consistently have these multiple 2D layers work together into creating a logical random maze, then that could theoretically work. Keep in mind that doors and key placement will probably be a bit tricky to setup.
Randomized levels is not in the scope of this template however since I am not too familiar with random level generation.
All code is commented in the project.
What happens is that the tilemaps drawn in the room editor are sampled and turned into 3D cube shapes by constructing the 3D vertices when the level starts (but only if they should be visible). The tilemap itself is then used as a texture source for the generated polygons. The texture source is a surface on which the (animated) tilemap is drawn for each used layer.
The camera projection handles the rest.
It's done using Game Maker Studio 2's vertex/camera/matrix functions.
The hit detection is handled by checking collision boxes and collision lines (using Game Maker functions like for example collision_line).
There's also options where you can set the scale (in tile-size units) of walls, so you can make the walls higher or lower (same with ceiling,...).
As for how to add your own textures, once you understand how to assign texture coordinates to vertices, it should definitely be possible to add that yourself. In fact, the "exit" object, the "door" objects,... already do that!
I used one of the songs (Tough Consequences) as part of a demo in my Arcade Shoot'Em Up template for Game Maker Studio 2 - A template with a full playable demo, that is basically a near feature complete source code for making games like that. It's the only track used since it's just a demo meant to showcase how music can loop - but it works really well for that purpose :)
I made sure to credit you and link to this page - with recommendations to check out your work. Same for the video I made to showcase what the template can do :)