Raycasting 3D render -- Blocks Edition

preview Walking Sway 2

  • set with this block as well, but 1~2 would be fine, and be float number, eg.: 1.5
  • the ratio of sway L/R and “jump” U/D is 1:3, can be adjust only in my code. To simplify the code and keep perf, they are in difference unit now, L/R is in screen pixel, U/D is in Z dimension pixel(ZOffset/ZPosition)
  • let me know if you feel current ratio is not reasonable or not comfortable.

@jwunderl @CarltonFade @Kiwiphoenix364
Hi guys!
as to the multi-level and floor/ceiling:
Thanks for your valuable suggestions! These will be adopt when I coding them.

I did some test, the FPS will down to about 8 on device/console with just drawing walls twice. So this extension is not fast enough to do these features right now, I think. We can’t add these until perf has a significant impovement some day.
But, I know, these are all attractive features, I love them too. I will do my best to optimize perf furture. I am thinking about a new optimized algorithm based on raycasting. But it is a big change, need some time to rewrite almost ALL the rendering codes of walls, and then check it works or not.
Hope I can made it. :rofl:

And leave your comments above 2 new previews pls. It won’t be merge into the extension, until you are satisfied with these results.

Thanks a lot for your support as always!


Hi @S0m3_random_guy
You mean the “myself” showing before a tilemap loaded, right?
Actually, this fixed in last release, but I found It was covered back by an accident. Will be fixed again in next release.
Sorry for that!


Well done Aqee!

Also, well done on the Camera Sway! It works really well, exactly as I thought it would look!
I’m looking to more of the wizardry you’re able to pull off.

Have a great day!


Go ahead, lol :sweat_smile:

1 Like

Do you think that you could maybe optimize by having a way to like load in walls with rendering? maybe looking like Minecraft’s system of only loading what’s in sight, and the sprites always stay there? idk that’s just a suggestion.

1 Like

Quick question: in future updates would be able to use the p2 controls for looking up and down?
(I won’t be mad/dissapointed if you say no, Makecode has a lot of capabilities, but not really for 3D/2.5D games)

1 Like

I know you’re rewriting the engine (and probably don’t want more suggestions), but it would be nice to have an option to render sideways as well, so you could make a first person 2d platformer!

1 Like

Ah, thanks for your advice for optimaization.
Our Arcade devices has some diff from a PC/Mac, we have no real external storage which will take advantage of loading partial resouces. If some day we can save/load files in SD card, this will be useful.

1 Like

Sorry, not sure your meaning with “sideways”.
Once a time, I tried to play my meowbit turned 90°, like this. Is it what you want?
(just a test at that time, keys doesn’t remapping yet )


p2 controls may be considered to support.
But raycasting can’t looking up/down very well. Maybe a little angle is possible, but not very useful, I thinks.


Yeah, I mean have the option to render it sideways, so you have looking up/down, INSTEAD of left/right, so you are basically the sprite in a platforming game, but you can’t look/move left or right. You can move up/down/forward/backwards instead of left/right/forward/backwards. (Kind of hard to explain, but basically you make the renderer flip the image by 90°.


Sorry, I am still not able to guess out what rendering effect you want. Would like paste a screenshot of that kind of game?
What I imagined is a traditional platform, like mario, but in 3D,something like this:

Yep, that’s what I imagined, but in first person instead of 3rd person.

1 Like

That’s easy, just remove the “person”, right?
But how to play with It?

How would you make a 3rd person camera with this though? Perhaps myself sprite following the sprite you want to control but i can’t figure out how to make directions properly

I think he means that you play as the 2d character through a first-person perspective. You can’t turn left or right but only can look up and down as it is in traditional 2D platformers.

The only problem I see is making the camera look up and down, but if you can manage something like y-shearing (a technique ppl used in the Doom engine to give the illusion of looking up and down), I think it could work.

@Kiwiphoenix364 @S0m3_random_guy @personalnote

  • Yes, this kind of game just is of a traditional 2d platform game, as well as control, except rendering tiles with 3d cube images. These Images can be build from tile image, and cached, and updated when view angle changing.
  • The y-shearing, I read it in one of your posts before, I will try to make it later when I am free.
  • Whatever, 1st person or 3rd person, this rendering is out of raycasting algorithm doing. But this effect is funny and maybe some one want it. And it’s possible to implement, and not very difficult, I think. It could be a new rendering extension. So shell we open a new thread, for discussing and developing it?
1 Like

I think that would be nice

Hi all
v0.3.14 just released.

  • again, fix takeover myselft sprite before tilemap loaded.
  • add particle effect support. Need provide duration value, doesn’t support default(empty) value.
  • add walking sway, set with “move With Controller” block
  • add get/setSpriteAttribute(), and docs
  • say frame closer to sprite
  • enlarge say size
  • some slight perf optimization

large area copying cause tremble(sayText and particle)

If you didn’t updated prev version v0.3.13, you need do following this time:
** there will be two extension “pxt-Raycasting” and “pxt-raycasting”, delete previous one please.*
** update setAttribute() name in your codes if there is.*