# Why are my enemy sprites not appearing on the screen?

**URL:** <https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365>\
**Category:** Game Development\
**Created:** [September 21, 2026, 5:43pm UTC](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365 "2026-09-21T17:43:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al881](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@Al881](https://discourse.libsdl.org/u/Al881)\
**Post date:** [September 21, 2026, 5:43pm UTC](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365/1 "2026-09-21T17:43:24Z")

</div>

Hi, I’m hacking together code from [Lazy Foo' Productions - Beginning Game Programming v2.0](https://lazyfoo.net/tutorials/SDL/index.php) and [SDL2 - Creating a 2D Shoot 'Em Up - parallelrealities.co.uk](https://www.parallelrealities.co.uk/tutorials/shooter/shooter6.php)

I have changed some strucys in t classes and replaced free and malloc with new and delete but apart from that my code is identical to that on the website. Why are my enemy sprites not appearing on the screen?

compiled with:$ g++ main.cpp -g -lSDL2\_image -lSDL2

```auto
https://www.dropbox.com/scl/fo/ms1m121kzswnya26opajz/ADQKFlVlj9irlL-tKkts__o?rlkey=i12g23vvxckvl6ie3loq5joh7&st=c0bz47ic&dl=0

```

---

<div class="post-metadata">

**Author:** ![Daniel1985](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@Daniel1985](https://discourse.libsdl.org/u/Daniel1985)\
**Post date:** [September 22, 2026, 6:10am UTC](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365/2 "2026-09-22T06:10:06Z")

</div>

Paste the code directly in your post(s) instead of some dropbox link.

If it’s too much code, create a github repository, put the code there and paste the link here.

---

<div class="post-metadata">

**Author:** ![Peter87](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/f07891/32.png) [@Peter87](https://discourse.libsdl.org/u/Peter87)\
**Post date:** [September 22, 2026, 7:17am UTC](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365/3 "2026-09-22T07:17:49Z")

</div>

You need to debug your code. Add temporary print statements or step through the code with a debugger to make sure the code does what it’s supposed to.

- Make sure that the spawn enemy function actually gets called.
- Make sure the enemy render function gets called.
- Make sure the enemies are spawned within the screen area.
- Make sure the enemies are being drawn where their x and y coordinates say they should be.
- And so on…

Eventually you should be able to pinpoint where the problem is.
