'Side scrolling game bullets are not appearing where I'm expecting
I'm using Xcode 13/Swift 5 to develop a side-scrolling game. The GameScene background is oversized but the game scene view is 1334x750. I have got the ship to move in all directions and when the ship reaches the edge of the oversized background, it loops to the other side (exit right enter left). When coding for shooting bullets (SpriteNode) I'm using the ship's location as the reference for where the bullet should fire from. However, I am experiencing some strange behaviors. When the ship is at location 0x0 the bullet fires from the same location and visually from the ship, however, when the ship is at 358x8 the bullet fires from this location but visually it is nowhere near the ship's location. What am I missing?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|