Alright, so I've been pondering over this for quite awhile now; looking through documentation, examples, previously made games, ect...
Basically (for those familiar with Box2d Lights), I'm trying to create bodies on top of my walls (so there's shadow casting, and so the light will stop instead of going through the wall). I have no problem creating, positioning, and updating the bodies, but the only real problem which I can't figure out is a way to make the filled body to be invisible or transparent so it shows my tileset (or wall) while still giving a shadow effect if light was casted onto it.
Perhaps I'm thinking or going about this the wrong way. Feel free to correct me.
Here's an image to display an example of a body I created on top of my wall. The shadows are handled properly, but I cannot see my wall.
Any help is greatly appreciated. Thanks.
You have two options here:
Set the shadow-dropping bodies behind the wall and use only transparent bodies for collision detection using BitMasks
Or render your wall sprites on top of box2dLights
Related
I'm making my very first game with libgdx, and it involves making levels with many right angles, very much like a maze. All I know how to make a collision is to make an invisible rectangle on each wall that collides with the player, but with so many walls this is an irrational solution, to make a rectangle for every single wall.
Since all the walls and edges will be black, is there a way I can make it so the player collides with anything the color black? That would be an incredible help.
I would suggest taking the time to learn how to use tile maps. Using tiles should help you accomplish what you want and there's already a bunch of tutorials on this, a few of them listed below.
Tile maps on the libGDX wiki
A tutorial on tile maps from gamesfromscratch.com
A YouTube tutorial on tile maps, which also covers collision detection
The tutorials I link may not apply exactly to your case, but they should hopefully point you in the right direction.
I've been trying to create a rectangular prism as indicated from here:
(example) http://desandro.github.io/3dtransforms/examples/box-02-show-sides.html
There's also a tutorial page.
but these are my results,
http://codepen.io/anon/pen/qFdiu
I don't know what is wrong here.. sometimes when I check a preview in chrome, it will animate, but not in the right place, the prism won't be in its container and it won't transform on the correct origin, i.e. like flipping a block on the floor it will move over, instead of being in its original place but on a different face. I've even tried copying everything from the tutorial but can't find out the fault. I am pretty new to webdesign. Would appreciate any help :)
So I'm incredibly new to AS3, and barely know my way around.
I built a simple colouring book game, essentially changing some of the graphics of a tutorial, and replacing numbers and sizes to fit what I wanted to achieve. I then built a menu screen in a seperate scene and linked the two with code snippets and buttons to go back and forth.
The colour pickers are generated when the game is ran, however an issue I seem to be facing is that when I go back to my main menu, they are still there.
Can someone point me in the right direction as to how I can fix this? I'm sure it's a rather simple fix. I can provide the code from the tutorial if needed
I think you're right you need removechild this color to remove one color from stage... Maybe you need removechildren to remove all color, whin are on stage... Try this two way
We're developing a game with impactjs that allows 'chaining' of entities as they are clicked. Basically this just draws a line between the two points, with a neon glow effect. So far, so good. Now, we have a request to make the 'chain' connections animated - fire, sparkles, etc. Essentially things that seem like they'd need actual graphic animations to look right. As the entities can be any distance/angle from each other, we're stuck at how to best implement a solution for this - that is, how to draw a diagonal image, for example, between two random points that we can animate. Any thoughts our suggestions on how to pull this off would be much appreciated.
Maybe create a particle entity with an Animation Sheet containing the necessary animations/particle effects. And then draw these particles along the line that from point A to point B.
When you want to animate it to fire/sparkles etc. run the animation for all those entities. in that line.
I'd be inclined to agree with Prat. Particle effects would most likely be what you need.
Here is a tutorial on generating particle effects in impact.js that might help you out.
http://www.pointofimpactjs.com/snippets/view/24/particle-effects-generation
Sorry for the maybe-trivial post, but I really cannot figure it out...
Let's suppose you have some 3d glasses or something that allows you a 3d stereo vision.
What happens if you invert left and right image??? Thinking at it I cannot really figure out it. Should you see the reverse of the image? Or just some axis-shift?
Unfortunately I cannot try it out in any way, but even if possible, I'd love to try to figure out and understand the thing with my mind before trying it.
So, please, any help, any idea, any hit that can help me to understand or to deeply discuss are welcome.
For the human brain it's next to impossible to give a formal answer, because frankly, neurologists still don't fully understand how it works in detail. But so much we know:
Our brain does no absolute "measurement" on the parallax in stereo images. The whole depth perception works on parallax differences. You could say, the brain takes the derivative of the parallax to build it's mental representation of depth. Derivative of Parallax and depth are taken to be (nearly) proportional. By swapping the pictures the derivative gets negative, so at every point the brain sums up depth in the wrong direction.
However parallax is not the only source for depth perception. Of similar importance is experienced knowledge about typical object in the world. For example faces are "known" to be never inside out, so even with negative parallax the knowledge will overrule and the face being percept in the right form (however it'll clash hilariously with the surroundings).
You would see it as "inside-out" (it's a little more complex than that, but that's the basic truth).
You can experience 3D without any special hardware, thanks to stereoscopic images (side-by-side, then crossing your eyes to see the images as one unique image).
You can then switch right to left, left to right by editing the image.
Here is an example with an image I've found on the web: https://imgur.com/a/ov7U7N5
Do you feel any difference in the depth? Do you see things inside out?
I believe the sense of depth in this case is preserved. But maybe it's just me.