Heelo,
I'm working on 2d endless runner game in libgdx using box2d.
My question is what is the easiest way ti implement shadow for the player which is jumping.
Shadow is just a semi transparent circle, but it needs to be animated when player starts to jump it should be shrinking, when landing it should be opposite
Hope you get an idea.
I have bunch of frames for that animation, but I'm not sure what is the best way to implement this.
My first question is how to detect where shadow should show up on Y axis, for example when player is landing on platform.
I thought of using ghost sensor that is below the player body and contact listener.
Or maybe should I ray cast to find platform beneath the player?
But then I cant know the right moment when player is close to the platform. What do you think?
Also how to calculate distance between player and platform body, so I can choose different frame of shadow animation?
Any thoughts on that?
Thanks.
Related
I've been charged with designing a demo for an isometric video game in ActionScript 3. I have the bitmap spritesheets that show the avatar I'm using standing and walking in each direction. The walking animation is made up of three frames.
My problem, though, is that I need to figure out how to make use of them. I'm not familiar with animation in Flash, and I need input on how to gotoAndPlay() the walking frames for the right direction. I don't think isolating the necessary DIRECTION is going to be a challenge, so much as starting it and keeping it going while the arrow keys are down.
My current code is basically comprised of keyboard handlers for KEY_UP and KEY_DOWN, each containing a switch-case statement that changes the Avatar.currentDirection property. The handler continues to fire while the keys are down, but I need to add animation to the game.
I've seen some examples where they simply embed the animations into an SWF, propagate an array of the various walking stages, and alternate between them using an EnterFrame event handler, but this seems really clunky. I guess in the end I'm trying to make use of Adobe Animate, but I don't know how you're supposed to do that.
Ops, fortunately i'm working with sprites (atlas animations) right now!.
if i'm right, you just needs to use them for playing some animation with functionality.
if you have a well sized sprite which is tiled with isometric slots like it:
(9 frames sized 64x128)
your work is very easy, only create new movieclip from library, inside it, create a borderless rectangle (which is our mask) in a layer (named mask) then import image to the project, and its better to disabling smooth ability from image properties,
now, inside your movieclip, you have to create new layer (under the mask layer) and add your sprite image for each frame, and change its position:
at last, enable masking for mask layer, then its time of coding,
name your animation queries (like image 3) and for loopable animations, insert gotoAndPlay('anim_name') inside last frame. i hope you are familiar with controling movieclip animations which is basic consept of any flash project.
now to extend it for 8 directions support, you just need to play and switch between dirctions according single and multi keypreses,
I'm working on wheel of fortune project but i'm currently struggling with the code.
I have attached the design of the wheel. I'm not a coder, i'm a designer and I need to do all the animation and the effects but I want to do it professional and that part is very important.
What I want to do is when you click on the spin button the wheel to rotate for 4-5 seconds with ease in/out effect and to stop each time on different random sector. Ill do different animations for each sector in separate movie clip and when it stops on a sector I want the movie clip related with that sector to start playing.
My idea is to make the wheel as a movie clip and each sector animation movie clips to be nested in it so when it stops that specific movie clip starts. Maybe I need to make each position of the wheel on key frame and to place the animations on these frames, but not sure if that is the right way.
One of the thing is that these movie clips with the effects should be easy for re position. I need to move them on the stage if needed and that's why i don't want them to be triggered with code.
If you can guide me step by step how to do that part I will appreciate your help. wheel design
Ok guys. There is a thread already for that and its something what I'm looking for. I like the example of the last answer in that thread, but I think that the first code will be more useful for my needs after that.
Can someone help me to make the code working, because I couldn't. All I need at the moment is to make the wheel spinning for 4-5 seconds on button pressed with ease in/out and it stops on random sector. Here is the link of the thread.
Spinning Wheel in flash AS3
I suggest you not to use keyframes at all. Use only one single frame, and in code, using a main class, instantiate all elements you need. To spin the wheel, you can consider using Greensock TweenMax or embedded tweening classes from Adobe. Also, spinning the entire wheel with all movieclips with nested animations inside, in spite animations are not running, forces to render all nested movieclips at each frame with a very heavy calculation load. I would suggest to either use 2 different clips, and add the animated one only when you need it, or at least to cache tentire wheel as a bitmap, and then uncache it when some animation is running inside.
I have to create a web page with an image of an opened hand and a storm of particles over it. Clicking on three buttons will change the particles (wood, plastic or water particles).
Currently, I created a video for the particles and put it on a canvas to render the transparency (using https://github.com/m90/seeThru) but I see a great lack in the performances of the page, and the video has difficult to run at 30fps.
Which is the BEST practice to achieve this effect with great performances?
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 wonder if it's possible to detect a simple shape like a circle or a rectangle in an image with ActionScript 3. Can somebody guide me into the right direction or even give me a link to a good tutorial? I want to detect a logo with the webcam. Thanks in advance.
Yes, it is possible I did a ball detecting algorythm for a video. Once you access the bitmap each frame, (ex. a vector>, where uint is the color of the pixyel in vector[x][y]), it is only universal detection algorithms. Hugh transform, etc.. So you go ahead, and detect rectangles. There are lots of tutorials. Its high math.. There is also FLARManager, what can detect cool qr codes in Flash. Lee Brimelow did a great video tutorial of it.