x = $x + 2; $this->y = $y + 2; $this->width = 12; $this->height = 12; $this->wallGrace = 99; // flies over the scenery, removed once past the screen } public function render(float $cameraX, float $cameraY): void { $renderer = $this->sdl->getRenderer()->getRenderer(); $texture = $this->getTexture()['texture']; foreach ([0x02, 0x04] as $i => $tile) { $src = new \SDL_Rect; [$src->x, $src->y, $src->w, $src->h] = RomSprites::skyTile($tile); $dst = new \SDL_Rect; [$dst->x, $dst->y, $dst->w, $dst->h] = [(int)round($this->x - 2 + 8 * $i - $cameraX), (int)round($this->y - 2 + 1 - $cameraY), 8, 16]; \SDL_RenderCopy($renderer, $texture, $src, $dst); } } }