New answers tagged

0

I had this same issue, I was using sprites with 8 different directions of movement. Here's how I detected which direction they were moving in: The way the sprite is facing depends on the direction they were last moving in. You can find the direction of sprite movement by performing some calculations on their original coordinates, and the coordinates of ...


1

Did you clear the screen? You have to use glClear() method to clear the screen before drawing the current frame. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Hope this helps.


0

From my own experience, I've found that using the sum of components (x + y + z) is a very good measure for sorting entities in an isometric scene. It doesn't perfectly represent the distance your image is away from the camera, but it does give an indication which image is further or closer to the camera, and that's what ultimately matters. Moreover, sums are ...


0

I fixed it: import SpriteKit func + (left: CGPoint, right: CGPoint) -> CGPoint { return CGPoint(x: left.x + right.x, y: left.y + right.y) } func - (left: CGPoint, right: CGPoint) -> CGPoint { return CGPoint(x: left.x - right.x, y: left.y - right.y) } func * (point: CGPoint, scalar: CGPoint) -> CGPoint { return CGPoint(x: point.x * ...


0

You should check that your spritesheet is power of two. for example: 3 tiles of 64x64 = one spritesheet of 192x64 ---> wrong 4 tiles of 64x64 = one spritesheet of 256x64 ---> right Even if each sprite is power of two itself. I hope this helps you.



Top 50 recent answers are included