I saw @Kiwiphoenix364 make a small Starfox demo and I though I wanted to try my hand at making Starfox in Makecode Arcade. Similar to KiwiPheonix’s, it is of course not “real 3D,” it just has the appearance of being three-dimensional.
Use arrow keys to move and press A to shoot(shoots a useless laser)
It isn’t really a game right now, just some physics. I was going to add some music using the ArcadeMIDI extension, but I couldn’t get much to sound good, so I took it out.
NEW UPDATE: I made the gound way better, added tilting, and more camera movement!
Also, i think the link to the first version is broken, and it will send you to this version, but it might just be my computer.
It runs at about 200fps on my computer, can somebody try how fast it runs on hardware?
I have the next update ready, but I am still fixing some bugs. Update 2 will have enemy turrets that shoot at you, a score system, bonuses for going through arches, extra lives, and some minor changes.
I tried running this in hardware (xtron pro) and it was decently fast. It regurarly drops down to 6 fps though, even 4 at some times but it’s not that noticable.
There is a way that I can compress it to run faster on hardware. This means doing things like making the ground renderer have less lines, and making the assets be smaller. I’m hoping it will run on hardware at at least 15fps, so you can experience the movement more.
Hey, @kwx, is your current 3d engine capable of doing something like this? I am interested in making my game using “real” 3d instead of my “fake” 3d. I think a simpler 3d engine with no shading might be more ideal for having it be more colorful, similar to the one used in the link above. I would love to learn how to make my own models using your code .
It’s generally possible, but performance is likely to get bad on hardware as graphics get more complicated. Check out Carrier 3D (unfinished work in progress) which has logic for drawing a horizon line, this could be extended to draw the ground in multiple sections.
In short, you’d need XYZ vertex coordinates for all the corners (I use graph paper for this), make polygon faces by connecting the vertices, and then assemble the model from them. That last bit gets a bit complicated since my renderer doesn’t handle depth automatically, so the models need to be defined as a binary space partition (BSP) tree. Basically, you need to use planes to slice the model into parts, and do that recursively until you’re left with convex parts that the render can handle correctly.
I’ve not had much luck finding a good online explanation for this use of BSP trees (most demos seem to use Java applets which aren’t exactly well supported these days), but https://www.youtube.com/watch?v=YT8ya4H-Z8Q looks helpful as an introduction.
Thanks for the info @kwx!
I have a question:
Do you have a project that is basically the raw 3d code? Kind of like your 3d graphics test but updated with the 8 grays 8 colors, the updated engine used for Carrier 3d and Space Rocks Revenge, and cleaner code? This would be useful for me to test out models and see how they look in Makecode Arcade.
See 3D graphics test - #18 by kwx for some context, and the post following that for a cube example. Like I said there, I think it would be difficult to turn this into a general purpose 3D engine. The code is finicky to use due to performance constraints and full of leaky abstractions.