So, in the tile based game I am working on, I wanted to make my sprites have 4 gray scale colors, and then have each tile or entity set the colors when the object is created. I then load the colors and set the pixels to reflect what entity is being drawn. I am doing this so that I can have multiple monsters use the same art, but just change the color. I also just wanted to see if I could do it.
As it turns out, everything was working perfectly, until I tried to make the zombie use the same art as the player, but with different colors. When I start the game with the zombies using the same art, it will not appear at all for the zombies (the zombies only have one image, while the player has a whole walk cycle) and when the player gets to that image in his walk cycle, it doesn’t show up at all, and looks like he is temporarily invisible.
I can’t pinpoint what is making this happen, so I am asking you guys for a bit of help. I will enclose a link to a .zip that contains two .jars (one without zombies that works and one with zombies that doesn’t work) and my eclipse work space with source.
I also should note that everything was rendering properly before I tried this out.
The only source files that should be needed are Zombie.java, Entity.java, Screen.java, Level.java, and maybe Player.java.
Thanks so much,
-Nathan
Download files here.