# Improved StarFox game

**URL:** https://forum.makecode.com/t/improved-starfox-game/18025
**Category:** Show & Tell
**Tags:** game
**Created:** [February 16, 2023, 7:27pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025 "2023-02-16T19:27:04Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [February 16, 2023, 7:27pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/1 "2023-02-16T19:27:04Z")

</div>

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)

> **[StarFox 3D](https://arcade.makecode.com/S72908-41805-43281-47776)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

It isn’t really a game right now, just some physics. I was going to add some music using the [ArcadeMIDI extension](https://forum.makecode.com/t/arcademidi-extension/15079), but I couldn’t get much to sound good, so I took it out.

---

<div class="post-metadata">

### Author: ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)
#### Post date: [February 21, 2023, 10:55pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/2 "2023-02-21T22:55:40Z")

</div>

really great gives ideas for making a version of slope I could make

---

<div class="post-metadata">

### Author: ![Unique](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unique/32/32724_2.png) [@Unique](https://forum.makecode.com/u/Unique)
#### Post date: [February 21, 2023, 10:55pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/3 "2023-02-21T22:55:58Z")

</div>

Hmm, I think I can make something like this using raycasting. I don’t think I’ve seen anything like that before.

Anyways, good job! The simulated physics is pretty cool and the collision for the arches is really neat. 😁

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [February 21, 2023, 11:00pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/4 "2023-02-21T23:00:45Z")

</div>

NEW UPDATE: I made the gound way better, added tilting, and more camera movement!

> **[StarFox 3D update 1](https://arcade.makecode.com/36395-31028-94948-24006)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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.

---

<div class="post-metadata">

### Author: ![hasanchik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hasanchik/32/5885_2.png) [@hasanchik](https://forum.makecode.com/u/hasanchik)
#### Post date: [February 22, 2023, 5:57pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/5 "2023-02-22T17:57:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [February 22, 2023, 6:00pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/6 "2023-02-22T18:00:51Z")

</div>

NEW UPDATE: added all of the things I promised in my last post.

> **[StarFox 3D update 2](https://arcade.makecode.com/21601-34640-76310-81784)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Now you actually have to use your laser cannons.  
You get an extra life every 5000 points

Ideas for next update:

- enemy starships
- mountains in background
- different kinds of obstacles
- an actual level layout instead of the obstacles being random
- the lasers to look more like the ones in the actual game

Please be sure to give me feedback and ideas for me to improve my game!

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [February 22, 2023, 7:19pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/7 "2023-02-22T19:19:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [February 27, 2023, 6:13pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/8 "2023-02-27T18:13:09Z")

</div>

Hey, @kwx, is your current 3d engine capable of doing something [like this?](https://www.lexaloffle.com/bbs/?tid=28067) 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 😃.

---

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [February 28, 2023, 11:22pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/9 "2023-02-28T23:22:19Z")

</div>

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)](https://forum.makecode.com/t/carrier-3d-unfinished-work-in-progress/10573) which has logic for drawing a horizon line, this could be extended to draw the ground in multiple sections.

As far as making models is concerned, that currently isn’t very well documented but you can take a look at the source code, for example the carrier model in “Carrier 3D” (see link above), or the enemy ship in Space Rocks Revenge: [[Announcement] MakeCode Arcade Mini Game Jam #4 - Outer Space Jam - #37 by kwx](https://forum.makecode.com/t/announcement-makecode-arcade-mini-game-jam-4-outer-space-jam/15689/37) .

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](https://www.youtube.com/watch?v=YT8ya4H-Z8Q) looks helpful as an introduction.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [March 2, 2023, 12:28am UTC](https://forum.makecode.com/t/improved-starfox-game/18025/10 "2023-03-02T00:28:39Z")

</div>

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](https://forum.makecode.com/t/3d-graphics-test/6285) 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.

---

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [March 6, 2023, 5:53pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/11 "2023-03-06T17:53:44Z")

</div>

See [3D graphics test - #18 by kwx](https://forum.makecode.com/t/3d-graphics-test/6285/18) 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.

---

<div class="post-metadata">

### Author: ![Future\_Knight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/future_knight/32/22166_2.png) [@Future\_Knight](https://forum.makecode.com/u/Future_Knight)
#### Post date: [July 5, 2024, 5:14pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/12 "2024-07-05T17:14:27Z")

</div>

it has been a long time mr. brohann

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [July 6, 2024, 8:36pm UTC](https://forum.makecode.com/t/improved-starfox-game/18025/13 "2024-07-06T20:36:52Z")

</div>

oh yea i was gonna remake this game but i forgot lol
