Tag Info

Hot answers tagged

7

The sprite design of that era was heavily influenced by the technical capabilities of that time. Both the Sega Genesis and the SNES had specialized hardware for drawing sprites. But in both cases that hardware only allowed sprites with width and height which were multiples of 8. Both systems also had a limit on the number of sprites it could draw every ...


3

You can attach the sprite to the child of the main game object which handles the collision detection logic. Whenever you want to flip the sprite just do it on the child object leaving the main object as it is. This way you can achieve your desired result :)


3

It looks like it's supposed to represent a motion blur or at least achieve a similar effect: to convey the feeling of movement and speed as the sword is swung in a arc. In 3D we sometimes go for similar effects with geometry or particle-effect based "trails" behind slashes. It looks the way it does for a variety of reasons, many of them due to the ...


2

There's nothing particularly inelegant or "unclean" about what you're doing already (toggling every frame), especially if you're also using a fixed framerate. If you're not using a fixed framerate, you may want to consider a slight change to toggle the sprite visibility based on elapsed real-time instead, as this will ensure a more consistent flicker rate ...


2

For those unfamiliar with the concept, the proper term is sprite flickering. Old consoles like the NES could only display a certain number of sprites simultaneously, so to work around this limit and show more sprites, games would show them on alternating frames. Your solution can get quite complex if you want to properly emulate the effect, that is, ensure ...


2

You need to flip the texture, not the object. Sprite/Plane meshes are one-sided so if you flip the actual object, you are seeing the back of it, which is transparent. Edit: You could also make your mesh two-sided. But Unity doesn't provide a flat, 2-sided rectangle. You will have to make it, either in a modelling program or with code.


1

If the sprites are in your Assets/Resources directory, you can load them programmatically as follows: Sprite[] spriteSheetSprites = Resources.LoadAll<Sprite>("spriteSheetName); This will yield a Sprite array containing all of the sprites from your spritesheet, indexed by their order on the sheet. A requirement to use this is that the image's ...


1

You could re-order your std::vector<Object> by creating a function that sort it by Y position of your objects void SortObjects() { std::sort(Object.begin(), Object.end(), CompareYAxis); } bool CompareYAxis(const Object first, const Object second) { //Do the comparison here } I think this would work.


1

I would forget right away the option to create the sprites in order based on their y coordinate as it will create a hell for you because it's not a flexible design. You look like you need a common way to handle the drawing process. You can achieve this using polymorphism. I would probably create a IDrawable interface, which requires children to have ...


1

I had the reciprocal of what I should have been using. The math.h class's sin and cos function want the arguments in radians and m_ShipAngle is in Degrees. I was doing movementX = m_ShipVel * (cos(m_ShipAngle * 180 / PI)); movementY = m_ShipVel * (sin(m_ShipAngle * 180 / PI)); When I should have been doing: movementX = m_ShipVel * ...


1

Ah yeah. Fire Emblem, a great game indeed. If you take a really close look to the critic attack of Lyn you will actually got it. The first slash is going from down-right to up-left. That will be the first slashing image starting from the left of the sheet combined with the second. So, we can say that the second slashing image is a continuation of the first ...


1

The solution suggested by Sebastian would work, but you'll end up with a lot of code just for a "fade out/fade in" animation. Libgdx has built-in functionnalities for that in Scene2D, you should use them. (Actions, Stage, Actor) That would make your code as simple as that : myPlayer.addAction(Actions.sequence(Actions.fadeOut(0.15f), ...


1

Why not set the alpha value of the sprites directly via sprite.setAlpha(float)? Of course you would have to call that by your rendering method and calculate the amount of alpha alteration using deltaTime. https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/Sprite.html#setAlpha-float-



Only top voted, non community-wiki answers of a minimum length are eligible