571
TI Z80 / Re: Chip's Challenge
« on: December 02, 2008, 10:40:12 pm »
Good news this time! I fixed another really annoying (and another cause for being seriously bummed-out) problem. The green switches toggle special walls on and off. I was having trouble figuring out how I would do this. I was thinking I would have to iterate over all of them, meaning I would have to keep track of them (meaning a whole lot more memory usage) and they usually come in groups of 20-30, thus really slow (cue jeopardy music...), then it hit me. Why change the state of the tile when you can change the tile itself? I just use another pic filled with the same tiles except the toggle walls are switched. Whenever the button is pressed I can put that pic into Pic1 (the pic I use for sprites) and just set a variable so I know they're switched (and the I can undo it too ). All of the walls appear switched, and since I'll be keeping track of the change there won't be a problem with movement routines!
This problem has been worrying me almost as much as the enemies were, so my morale is back up
(If you can't tell I'm reeeeeally happy about this )
[edit] That makes 6 happy faces out of 5 (now 7/5...)
This problem has been worrying me almost as much as the enemies were, so my morale is back up
(If you can't tell I'm reeeeeally happy about this )
[edit] That makes 6 happy faces out of 5 (now 7/5...)