Page 1 of 1

WIP: 4k Monopoly

Posted: Thu Sep 02, 2021 3:00 am
by Crayon21
currently need help getting the objects to move according to the input
(I.E if you roll 3, the character needs to move 3 spaces)
ideas?

Re: WIP: 4k Monopoly

Posted: Thu Sep 02, 2021 10:02 pm
by dr beep
Make a table with cooridinates per field, go to next field and print at the coordinates at that field.

Re: WIP: 4k Monopoly

Posted: Fri Sep 03, 2021 2:06 am
by Crayon21
um...how exactly? Can't i just get a grid reference of the zx81's screen locations?

Re: WIP: 4k Monopoly

Posted: Fri Sep 03, 2021 9:31 am
by dr beep
DIM P( nrfiledsonboard, 2)

P(1,1) holds Y-pos for PRINT AT
P(1,2) holds X-pos for PRINT AT

Where those positions are… that is up to you.

Re: WIP: 4k Monopoly

Posted: Sun Sep 05, 2021 6:09 am
by Crayon21
then i assume i print at?

Re: WIP: 4k Monopoly

Posted: Sun Sep 05, 2021 1:10 pm
by Dim_75
First try to practice the FOR-NEXT loop. Having a FOR without a NEXT is useless.
See chapter 12 of the manual for some help : http://otremolet.free.fr/otnet/otzx/zx8 ... hap12.html
I really think you have to understand how to make a loop with FOR-NEXT if you want to go further

Also, the input command in your program do not have any test for the input.
You can input a random character, the program will will not print "you rolled" but will continue anyway.

Re: WIP: 4k Monopoly

Posted: Thu Oct 21, 2021 12:57 am
by Crayon21
is the contest over?

Re: WIP: 4k Monopoly

Posted: Fri Oct 22, 2021 3:31 am
by XavSnap
Hi,

dr beep, the P$ array will be better to preserve some memory room...
DIM P( nrfiledsonboard, 2)

P(1,1) holds Y-pos for PRINT AT
P(1,2) holds X-pos for PRINT AT

Code: Select all

10 FOR X=1 TO 5 STEP 2
20 LET P$="£$:?()"
30 PRINT AT CODE(P$(X)),CODE(P$(X+1));"*"
50 NEXT X
Where Y1 is 12,X1 is 13, Y1 is 14,X1 is 15...
Don't need the DIM command.
#location(y,x) = (X-1)*2+1
#location 3 =(3-1)*2+1= offset 5 in the P$ array.


The better way to preserve the Vars mirroring, is to create a REM with characters, en PEEK the value…

Code: Select all

1 REM £$:?()
5 LET TABLE=16514
10 FOR X=3 TO 1 STEP -1
20 LET DEP=(X-1)*2
30 PRINT AT PEEK(TABLE+DEP),PEEK(TABLE+DEP+1);"*"
50 NEXT X

:ugeek:

Re: WIP: 4k Monopoly

Posted: Fri Oct 22, 2021 4:00 am
by XavSnap
2monopoly.p
(14.95 KiB) Downloaded 92 times
4k, juste for the variables memory room…
:lol: