How to not hard code sprites
Moderator: Moderators
-
- Posts: 10
- Joined: Tue May 04, 2021 8:49 pm
How to not hard code sprites
Currently I’m hard coding my sprites. I know, it’s a pretty bad practice, and I’ll soon need to rework a lot of code. So instead of procrastinating I think I’d better get to it as soon as possible. My problem is I don’t have a clue where to start. Or perhaps I do, but I just underestimate the amount of code needed (since I currently with hard coded sprites don’t need any variables or tables). Could someone please guide me in the right direction?
Re: How to not hard code sprites
The wiki has a pretty nice article on this:
http://wiki.nesdev.com/w/index.php/Don% ... _addresses
The short version: use a byte as an index into your shadow OAM, and have any sprite drawing routines use that index instead of hardcoded addresses.
http://wiki.nesdev.com/w/index.php/Don% ... _addresses
The short version: use a byte as an index into your shadow OAM, and have any sprite drawing routines use that index instead of hardcoded addresses.
Re: How to not hard code sprites
I posted an example metasprite subroutine recently: viewtopic.php?f=10&t=23011&p=272984#p272984
-
- Posts: 10
- Joined: Tue May 04, 2021 8:49 pm
Re: How to not hard code sprites
Thanks a lot!
It makes things a bit more clear to me.
It makes things a bit more clear to me.