Here it comes finally.
It took me several days to find out how raycasting render would work with existing blocks/functions and Arcade game platform together. After read many source codes to try to inject my codes in, the last supposition worked. That is take over tilemap’s renderable instance and all sprites created in current scene to prevent them from being drawn, and keep them in physical engine to make overlap things happen at meanwhile, and then register frameHandlers to draw tilemap and update&draw sprites.
Let me know pls, if there is a more proper/elegant way.
Also need suggestions to impove, really appreciate!
Basically, this render just draw a traditional tilemap game into “3D view”
setTilemap(), walk around with arrow keys
Do your game as usual
sprites, suggest sprite.setScale(0.5) for each, set directional animations with provided animation block.
work together with most of Arcade blocks and extensions, sprite, projectile, overlap,…
except these drawing screen directly, sprite effects/saytext …
Operate view pos and collision size with provided “myself sprite”, and view direction with “setViewAngle” block
Switch view mode with block “setViewMode to tilemap(2D)/raycasting(3D)”
Zoom in/out by set fov
Performing: To compactible with existing blocks, many codes are added in, the perf goes down significantly, need tuning later.
The Arcade phyical engine worked fine if sprite image is square. But if not, say a tall tree, collision will occured before hit the wall at y axis.
Reason: The physical engine working in 2D mode, that consider sprite image as its size(x&y direction). But 3D render consider the image width as size for both x & y axises, height as sprite Z-axis size. This could be fix by override the physical engine, in future, if needed.
Sprite sayText, particles, effects
Override physic engine.
Perf tuning, Fx8
Pose depended animations, stand, walk, attack. Any one need?
function/block for disable controller codes in this extension, so user can control “myself” in user code
You could use the sprite’s “bottom”, “top”, “left”, or “right” anchors, so it wouldn’t matter what size the sprite was. Just an idea, instead of coding a new physics engine. (IDK if I fully understand the above quote, but I think this might work)
this is AMAZING i can do so much with this but just wondering is there a way to make the myself sprite jump or have a character in front cause with this i could make maze games snic robo blast 2 or super mario 64 or even some type of minecraft like game if you can add layers onto this
Thanks @Kiwiphoenix364 for your suggustion !
The sprites top,left,right,bottom are critical for collision. They all are “mapped” into hitbox when create, with which physical functions calculate , and it will be “re-map” every time setImage(). So user need notice extension to update hitbox every time after set a new Image (need user learn more about this extension). I will try to dig deeper to find whether this can work. If yes, it still need a balance between simple implement and easy learning(convenience).
Thanks again for providing me more idea, very appreciated!
yes, jump maybe possible, but be aware it’s not “jump on” to some cube or platform, cause infact every cube have no top/bottom surface.
yes, I should say sorry for this, it’s a bug, that sprites with flag “relative to camera” are tookovered too by my render, so they would not be drawn as HUD alike.
Check out new release please (v0.3.3). (to update:In your game, goto JS mode and press refresh button next to the name of my extension in files list at leftside)