preloaded Images vs. rotated Images

Started by
2 comments, last by Madolite 9 years, 7 months ago

Hello everyone,

I'm programming a 2D zombieshooter with a perspective like GTA or Hotline Miami and I'm thinking about how to manage rotating the sprites. I don't know if it's better to create an image for every direction and preload them or rotating the images at runtime and have a more complicated collision detection. But in the first case maybe I have an overflow of RAM if the game has many moving objects.

Can you help me?

Cheers,

Mr. Moon

Advertisement

I don't think RAM is going to be an issue. Let's say you have 5 different zombie sprites, and you put up 100 zombies on the screen, 20 of each type. There's only 5 copies of the sprite in memory with 20 references to each.

Performance won't be an issue either since computers are so darn fast. Rotating a sprite with a matrix operation vs. having different direction sprites will be negligible. You'll be better off making this decision based on other factors such as: look and feel, art resource complexity, etc.

- Eck

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

I don't think RAM is going to be an issue. Let's say you have 5 different zombie sprites, and you put up 100 zombies on the screen, 20 of each type. There's only 5 copies of the sprite in memory with 20 references to each.

Performance won't be an issue either since computers are so darn fast. Rotating a sprite with a matrix operation vs. having different direction sprites will be negligible. You'll be better off making this decision based on other factors such as: look and feel, art resource complexity, etc.

- Eck

^^^^ This. Programmers are really bad at guessing where the problems are going to be in our software. Do the simple thing and test the FPS.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Also, don't forget that you can flip sprites, as well. :)

This topic is closed to new replies.

Advertisement