Zoom/ADS (The change in view only changes when the system registers a button input (e.g. W or D))
Firing with recoil
Hand-drawn art
Armour + Health system (No enemies yet so can’t test that; I will elaborate later)
Realistic ammo counter with max ammo limits
Now, for some help:
I’m no Javascript expert (Nor novice), so I can’t really delve into the raycasting stuff. That being said there are no enemies. This is because I have actually no clue as to how to code them. If anyone has any ideas please go ahead
Remember, this is still a demo so expect updates and calls for help!
Developer Notes:
While making the demo I actually didn’t know how to increase the FOV for the zoom (Or to give the illusion of zoom), so I considered switching out the ADS for a pistol. But in the midst of coding the pistol, I found out that changing the FPX scale changed the FOV.
In case you want to add enemies, I know that the tutorial below is for scratch, but it does have the basic idea of how to do depth sorting, and with Makecode’s new scaling, a code similar to this might work (obviously accounting for how more positioning in makecode has to be done manually, but the general principle is there). I don’t do scratch, but I watched the whole series that these two videos below are from and some of the concepts are really cool and could work for this game!
This is really interesting! I’ve made the ammo counter slightly weaker because it needed more elaborate code that I was not bothered to do. The minimap is also a really cool and neat addition!
After a whole weekend, the first sprite is caming…
Just worked, I am understand all codes in detail, still need more study
And more features, optimizations will come also in recent future…
Hi @personalnote
This sample is special for you, FOV and Sprites are all inside.
See animation.ts in pxt-raycasting extension for how to define your enemy sprite animation.
Thanks you for your cool project, which like the rabbit hole I falled in, and got lots of fun.
No problem! This looks especially cool! I just might have to get on Makecode Arcade just to try this out, so a new demo might release soon! Thanks for the tip!
@AqeeAqee I tried to provide an update to the demo but the sample you sent me couldn’t be converted to blocks. Not to mention there were extension errors.
@personalnote
Sorry for that issue, I have no idea why it work when I post, but can’t work now.
The fix is easy: Just replace the line with “pxt-Raycasting” to following, in pxt.json file(click “edit settings as text” button) "pxt-Raycasting": "github:aqeeaqee/pxt-raycasting#v0.2.0"
like this:
BTW, if you are just starting to make new version of your project, I strongly suggest you using new edition of this extension. Feel free ask me pls if you have any quesion on migrating to new edition.