Monopoly
Moderator: MaxCoderz Staff
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Ok, so it took forever to get to a chance tile. Sorry about that. Also, I fixed the thing when you land on St. Charles, I think it was. I had accidentally tossed in an extra value so I deleted it. It no longer costs 38057 whatever dollars .
Last edited by chickendude on Thu 03 Aug, 2006 5:29 pm, edited 1 time in total.
That looks great.
It's always nice to see screenies, no matter whether it is the finished version or not. This definately looks better than the old asm monopoly.
I'd help you with the sprites, but I'm terrible at it.
Hmm, I wonder whatever happened to theCheat. he always used to do a bunch of good pixel art.
It's always nice to see screenies, no matter whether it is the finished version or not. This definately looks better than the old asm monopoly.
I'd help you with the sprites, but I'm terrible at it.
Hmm, I wonder whatever happened to theCheat. he always used to do a bunch of good pixel art.
In Memory of the Maxcoderz Trophy
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Thank you!
And MadSkillz has offered to draw the sprites (and drawn a few already!) so soon I'll have the updated character tokens.
I just devised how I'm going to handle chance cards. Each line of text is a 0 terminated string is displayed with vputs. Therefore, since vputs stops at the byte after the 0, that's where I'll store the macro-type things. We'll say there's 10 different options that can be taken: cp 10 \ jr nc, display_next_line \ blah stuff that handles the macro things.
Simple enough. I also copied/pasted the text for the community chest cards from wikipedia into the chance routine.
I'm still wondering how I should handle the get out of jail free card. I could overwrite it with null values, then check for the null value and if I get it skip to the next card to read it, however the way I shuffle the card shuffles the array they're in. Therefore, if I did that method I'd have to initialize the array everytime a new game was started.
I could also shift each piece of the array left and pop the get out of jail free card onto the end of it, then have a variable toggle whether or not to check for 15 or 16 cards...
Any suggestions? On anything? Comments?
And MadSkillz has offered to draw the sprites (and drawn a few already!) so soon I'll have the updated character tokens.
I just devised how I'm going to handle chance cards. Each line of text is a 0 terminated string is displayed with vputs. Therefore, since vputs stops at the byte after the 0, that's where I'll store the macro-type things. We'll say there's 10 different options that can be taken: cp 10 \ jr nc, display_next_line \ blah stuff that handles the macro things.
Simple enough. I also copied/pasted the text for the community chest cards from wikipedia into the chance routine.
I'm still wondering how I should handle the get out of jail free card. I could overwrite it with null values, then check for the null value and if I get it skip to the next card to read it, however the way I shuffle the card shuffles the array they're in. Therefore, if I did that method I'd have to initialize the array everytime a new game was started.
I could also shift each piece of the array left and pop the get out of jail free card onto the end of it, then have a variable toggle whether or not to check for 15 or 16 cards...
Any suggestions? On anything? Comments?
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Alright, so I tossed in those sprites that Madskillz drew, and they look excellent This weekend I'm going to try to integrate the chance and community chest routines, so that I don't need two separate routines.
Oh, and I'm also encroaching 8,000 bytes (currently around 7750). I'm really scared of going over 8k. 7k wasn't so bad, as I essentially jumped from 6 k to 7.5k just by adding in all the text from chance/community chest and the other sprites for the characters (each character takes up 48 bytes, 24 for the sprites and 24 for the masks). But 8k really reflects how inflated my code is.
Example:
The problem is that once I finally get a section working, I'm too sick of it to try and optimize it so I move on. Then later when I come back to it, I can't remember exactly how everything worked and don't feel like going through it again. Haha, I'm so lazy.
Oh, and I'm also encroaching 8,000 bytes (currently around 7750). I'm really scared of going over 8k. 7k wasn't so bad, as I essentially jumped from 6 k to 7.5k just by adding in all the text from chance/community chest and the other sprites for the characters (each character takes up 48 bytes, 24 for the sprites and 24 for the masks). But 8k really reflects how inflated my code is.
Example:
Code: Select all
checkPosition:
ld hl,playerdata+2 ;this is their position on the board: 0=GO, 1=baltic ave, ...39=park place, etc.
inc (hl)
ld a,(hl)
cp 40 ;if a is maxed out at 40
jr nz,skipsub
xor a ;subtract 39 to reset it
skipsub:
ld (hl),a
inc hl ;playerdata+3 loads which direction to move the map (L, R, U, D)
cp 10 ;10 means we've landed on jail, the lower left corner. we can no start going a different direction
jr nz,skip1
inc (hl)
skip1:
cp 20
jr nz,skip2
inc (hl)
skip2:
cp 30
jr nz,skip3
inc (hl)
skip3:
or a
ret nz
ld (hl),a
ret
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Last night I worked on it a little bit and decided to start optimizing some things. Well, I wrote my very own masked sprite routine (before, I was using one by James Vernon that also clipped sprites, which I don't need) and I cut down in some of the "non necessities" in the dice routine, and managed to clip off about 300 bytes. I've decided to start work on saved games and such (as custom-named appvars), as well as a rudimentary system for the different options.
For saved games, I was thinking of doing something like if you load a game and quit, it saves automatically. If you start a new game, it asks you if you want to save and if yes then prompts you to enter a name (my first input routine, self-coded ). So if you load a game, you HAVE to save it; you can't just quit and restart.
Oh, and for the record kroot has me blocked on AIM.
For saved games, I was thinking of doing something like if you load a game and quit, it saves automatically. If you start a new game, it asks you if you want to save and if yes then prompts you to enter a name (my first input routine, self-coded ). So if you load a game, you HAVE to save it; you can't just quit and restart.
Oh, and for the record kroot has me blocked on AIM.
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
8811? If that's the case I shouldn't have any trouble optimizing it occasionally to keep it low enough not to bother. And yea, it would just be a matter of setting the include for the board data at the end of the includes, it's just nice having them in alphabetic order (I'd have to come up with a new name for it ).
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Hm... I started work on the saved games, and I must say that it was much easier than I thought. The input routine took about 20 minutes to write, creating the appvars was simple (although I had to define the romcall, cause it's not in ion.inc), but there was one problem. I had to use one of those IFDEF 83P things, because the 83 doesn't have appvars! So how should I store data for the 83? I could make it so that you can only have one saved game, then append the saved game data to the end of the program... But that's too boring. I could save it into a custom-named, hidden list, perhaps. It might make more sense to just append it to the end of the program, though, as the 83 has far less memory.
Thoughts?
Thoughts?