Screenshots

Chickendude's remake of the famous Monopoly board game
  • Author
  • Message
Offline
User avatar

chickendude

Staff Member

Topic Starter

Screenshots

Post23 November 2011, 20:48

Every good project that will never be completed has its own collection of enticing screenshots of the game you will most likely never play, so why not this one?
Image
(And yes, NanoWar, another buggy SS, i restarted it like six times but that chance card always popped up :P)
Showing off the new menu and buying properties:
Image
Offline
User avatar

NanoWar

Site Admin

Re: Screenshots

Post23 November 2011, 21:47

Hahaha, very good!

Re: Screenshots

Post24 November 2011, 19:11

I hope we could play it one day ;)

It seems there's a lot of progress...
Some new sprites by example?

One little technical question :D : how do you draw the numbers value in small font?
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post24 November 2011, 23:57

Hehe, the numbers in small font are drawn by my text routine. I'm using a custom font for Monopoly, here's my code to convert it into a decimal format and remove the leading 0s, which the SS doesn't show, as i added it after taking the screenshot:
Code: Select all
;#######################
;#DISPNUMBER
;#Display the number stored in HL
;#input: hl = number to display
;#######################
dispNumberAlign:
    ld a,20
    ld (letRow),a
    ld (letCol),a
dispNumber:
    exx
        ld de,numberText2
    exx
    ld de,-10000    ;check how many 10,000s there are in the number
    call dN_b2d
    ld de,-1000     ;check how many 1,000s units there are
    call dN_b2d
    ld de,-100      ;hundreds
    call dN_b2d
    ld de,-10       ;tens
    call dN_b2d
    ld de,-1        ;single digits
    call dN_b2d

    ld c,-1         ;this part here removes the leading 0s
    ld hl,numberText2
    ld a,(hl)
    inc c
    inc hl
    cp 10           ;ten ($0A) is the value of 0 in my alphabet (i think ASCII uses $20?)
    jr z,$-5
    ld de,numberText2
    ld l,e
    ld h,d
    ld b,0
    add hl,bc
    ld a,6
    sub c
    ld c,a
    ldir            ;essentially, for every 0, shift the number left one.

    ld hl,numberText2
    call drawText   ;now the text is a string (ending in $FF, my EOS (end of string) marker)
    ret

dN_b2d:
    ld a,-1
dN_b2dloop:
    inc a
    add hl,de
    jr c,dN_b2dloop
    or a
    sbc hl,de
    exx
        ld hl,numberTable
        ld b,0
        ld c,a
        add hl,bc       ;hl=numberTable, bc = number of units
        ldi
    exx
    ret

;the "ASCII" numbers of my text characters
; it's different than normal ASCII because
; i used a custom character table
numberTable:
.db 10,57,36,37,38,39,40,41,42,43
numberText2:
.db 0,0,0,0,0,$FF
Remember, adding a negative number is the same as subtracting ;) and much simpler here, as you don't have to worry about the carry (there's no sub hl,de, only sbc: subtract with carry).

You could modify this code to work for TI's text routines, just make sure the string ends in 0 and not $FF :D You also wouldn't need the "numberTable", as in ASCII all the numbers (and alphabet) are stored sequentially, in other words, if you did ld a,'0'+5 a would equal '5'. If you have any questions, feel free to ask (or if you want help modifying it for TI's routines).

Also, here's a ss to prove that it does indeed work :P
monopoly.gif
number displaying routine
monopoly.gif (107.6 KiB) Viewed 32924 times
Also note, something i hadn't mentioned before but happened by chance in the ss: the current player is displayed on top, so if there is more than one person on the same tile, the player whose turn it is is drawn on top (aka, last) :) You can see it in player one's second "roll", they move to the top.
Offline
User avatar

NanoWar

Site Admin

Re: Screenshots

Post25 November 2011, 00:01

Are interrupts disabled? Or why do you use "exx"? I never dared.
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 00:05

Yeah, interrupts are disabled. Here's the first line of monopoly:
Code: Select all
initialize:
    di
    ld hl,$89EC     ;byte after saferam1 (savesscreen) (creando nuestro "saferam")
    ld de,saferam3  ;guardar los valores aqui para no estropear todo
    ld bc,78
    ldir            ;guardarlo
 
:P
I probably overuse them, it's so much quicker and easier to use and really you don't have to worry so much like with push/pop (oh, is there still anything on the stack? argh, i need to pop a couple times before quitting!) and is an easy way to double the number of registers you can use. My tilemap routine couldn't exist without the shadow registers!
Offline
User avatar

NanoWar

Site Admin

Re: Screenshots

Post25 November 2011, 01:14

Well it's challenging sometimes, I admit.

Re: Screenshots

Post25 November 2011, 10:31

Thanks for your piece of code.
But I'm always asking why there's no tios routine to do something like this. Because dispHL do the job, but I can't figure out how to adapt it for small font.
Anyway, if I need to do that, I will probably steal your routine. If you're ok of course :)
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 11:01

My code will always be free to use without restrictions for whatever you want, you can consider it yours :) And _dispHL really is handy, but unfortunately as you mentioned it only works with the large font. TI obviously has a routine to display small text numbers (look at the graph screen, for example).

Re: Screenshots

Post25 November 2011, 11:06

Thanks !
What's the name of the ti routine?
If there's already a routine, why have you done yours? o_O

edit: when you said : "I have done my text routine" . What is the aims of this routine? Cut text to fit in one box? Add carriage return when needed? Is your text routine handling the boxes around the text or is it done by another part of the code.
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 11:52

I suppose TI has a routine they use, but i don't know if we have access to it.
Basically, here's how i store my text:
text1:
.db "This is a sample of how i store my text. One long string.",$FF
Then when there is no more space to draw a new word, i call newLine to jump down to the next line. The routine also handles the box that is drawn around it and i am currently writing in a menu routine so that you can do something like this:
.db "You are at the store. Do you want to",$FD,"go in",$FD,"go out",$FD,"don't care",$FF
which would create a small menu sort of thing with three options to choose. It should be finished before soon and i'll upload a picture (i like screenshots!).

Before the text routine was a little cleaner, but i needed to break it up a bit, at least for now, because i may not always want to draw a box around the text (like the dice rolls). I'll show you some sample code snips:
Here's what happens when you land on or pass go, the most simple textbox, one string:
Code: Select all
passedGo:
    push af
    call drawTextTop
    ld hl,textGO
    call drawText
    call drawTextBottom
    pop af
    ret

Here's the chance part:
Code: Select all
landChance:
    call drawTextTop
    ld hl,textChance
    call drawText
    call newLine
    ld hl,chanceDeck
    call drawCard       ;ici draw != dessiner mais "prendre"
    call drawText
    call drawTextBottom
    ret

and lastly, landing on a property:
Code: Select all
landProperty:
    call drawTextTop
    push hl
        ld hl,textLandedOn
        call drawText
    pop hl
    push hl
    ld a,(hl)
    inc hl
    ld h,(hl)
    ld l,a
    call drawText
    call newLine
    ld hl,textPropertyPrice
    call drawText
    pop hl
    inc hl
    inc hl
    ld l,(hl)           ;the mortgage value
    ld h,0
    add hl,hl           ;the price is 2*mortgage
    call dispNumber
    call newLine
    ld hl,textBuy
    call drawText
    call drawTextBottom
    ret

So first, you draw the top border of the box, then what ever texts you want drawn inside the box (the drawText routine draws the side border), then lastly we draw the bottom border, which uses the final coordinates to know which row to draw to (short texts have shorter boxes, long texts have longer boxes).
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 12:17

So here's a ss of the menus, they are inline, so if you want you could include more text afterwards (though you can only have one menu per textbox) and are handled by the text routine. You could theoretically have as many choices as you'd like (memory permitting ;)), but right now my text routine doesn't handle large texts which overflow beyond the screen (as seen in the first screenshot above :D).

Now i can get to work on buying properties!
Attachments
monopoly.gif
menus
monopoly.gif (41.62 KiB) Viewed 32914 times

Re: Screenshots

Post25 November 2011, 12:41

Nice !

How do you get the response of the player? (I would say after the player hit enter)
You must hardcode the checkbox coordinates to change the sprite (full/empty) ?
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 13:18

What i do is i store the coordinates of the box as i loop through the text:
Code: Select all
       ld hl,numOptions   ;how many items (check boxes) in the menu
        inc (hl)
        ld a,(hl)
        add a,a         ;a*2, each entry has 2 bytes: y,x
        ld c,a
        ld b,0
        ld hl,buttonCoords
        add hl,bc         ;add a new set of coordinates (don't overwrite the old ones)
        ld a,(letRow)   ;current Y address of the sprites (basically, penrow)
        ld (hl),a
        inc hl
        ld a,(letCol)   ;current X address (pencol)
        inc a           ;we need to shift over one column to draw INSIDE the box
        ld (hl),a

Honestly, i was surprised by how easy it turned out to be, pretty much everything was already taken care of in the text routine (the boxes are basically handled like letters). To shift to a new box, i just load the coordinates of the next box and draw the sprite.
Code: Select all
mK_left:
    ld a,(de)
    or a
    ret z
    call highlightButton    ;erase the button
    ld hl,curOption
    dec (hl)
    call highlightButton    ;draw the new button
    jr waitKeyReleased      ;instead of call XXX / ret

mK_right:
    ld a,(de)
    cp (hl)
    ret nc
    call highlightButton    ;erase the button
    ld hl,curOption
    inc (hl)
    call highlightButton
    jr waitKeyReleased      ;instead of call XXX / ret
Offline
User avatar

NanoWar

Site Admin

Re: Screenshots

Post25 November 2011, 14:20

I like to be able to press clear to escape from every menu/screen, so that clear defaults to "don't do it".
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 14:44

I like something like that too, i just haven't implemented it yet. Right now i'm just going to try to finish as much as i can before the deadline and smoothen things out later :)

Re: Screenshots

Post25 November 2011, 16:01

Yes, pressing clear to say "don't buy" could be a good idea.

If I remember correctly, when you play monopoly, you usually "don't buy" the most part of the time.
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post25 November 2011, 16:22

That's why i switched "don't buy" to be the first option. Also, all my menus wait until the keypad is cleared before accepting new values, so if you hold down left/right/2nd it won't do anything, you have to release it first then press (to avoid accidentally buying something, skipping past something, etc.)

Re: Screenshots

Post25 November 2011, 16:26

Yes, I was coming back to say something like "in other hand, you could just switch "buy" and "don't buy" so "don't buy" would be the default choice..."
But it's already done :D
Nice :)
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post26 November 2011, 19:48

I also made the main game menu (Roll/View stats/Exit) but it's got the same dimensions as the other boxes. Should i maybe shrink it down a little? It just uses the regular menu routine, same as the buy property menu. Btw, you could theoretically play with a friend now, as you now have to pay someone when you land on their property. You can't really lose yet, though. I guess i should also mark properties that are owned, but how?
Attachments
wabbitemu.gif
wabbitemu.gif (1.68 KiB) Viewed 32873 times

Re: Screenshots

Post27 November 2011, 16:17

About the menu, keep the same boxe, but add at least 3 or 4 spaces between the check box and the label. It should look better like this.
Anyway, nice screenie as always :)
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post27 November 2011, 17:18

Here's a new (as usual, buggy) screenshot. It takes advantage of the new text system to make displaying things like the player number, money, etc. easier. I'm not sure if it saves space, it might even be a little larger now, but i think it's worth it. Soon i'll need to add the ability to insert a string to take care of the properties page, but that'll be easy. The hard part will be getting my textboxes to scroll when the text is too large. Still not sure how i'm going to go about it. Also, landing on another player's property shows you who you are paying (give player X $XXX)
Attachments
monopoly.gif
monopoly.gif (238.34 KiB) Viewed 32866 times

Re: Screenshots

Post05 December 2011, 21:59

Hey this looks pretty nice. I also really like the custom font, it looks great! Did you design it yourself?
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post05 December 2011, 23:42

Yeah, and with NanoWar/MadSkillz help on which letters looked absolutely awful :) Thanks! The source is available if you wanna use it/play with it, feel free to use it however you want for whatever you want, after all, that's what it's there for!
Offline
User avatar

chickendude

Staff Member

Topic Starter

Re: Screenshots

Post10 December 2011, 18:16

I've reorganized the text routine to support texts that are too large for the screen. There's still a limit, i think like 75 pixels or 12 lines of text, but it's better than it was before!
Attachments
monopoly.gif
new text routine: scrolling text
monopoly.gif (116.83 KiB) Viewed 32802 times
Next

Return to Monopoly

Who is online

Users browsing this forum: No registered users and 1 guest

cron