Jump to content
IGNORED

Rainy Day Game Contest (RDGC)


adamantyr

Recommended Posts

official : i started my game ;) and it's about water ...

 

Awesome! Any more info available yet? What language are you writing in?

 

Adamantyr

 

it will be basic compiled... but i promise you, you won't notice difference with pure ASM game ;)

it will be a port of a very famous game : pipe dream !

  • Like 1
Link to comment
Share on other sites

Here is a planned submission: an Advanced Wars clone in Forth.

 

I'm still learning the language, I was hoping to show more than this.

 

http://www.youtube.com/watch?v=3j38ISWk7sg

 

 

DECIMAL
: CREATE2 ( -- ) <BUILDS DOES> ;
: CELLS ( n -- n ) 2 * ;
-1 CONSTANT TRUE
0 CONSTANT FALSE

33657 CONSTANT TIMER
33728 CONSTANT SEED

: CHAR ( n addr -- )
 SWAP 8 * 2048 + 8 VMBW ;

: PUTCHAR ( char col row -- )
 32 * + C!VDP ;

: COLOR ( color charset -- )
 896 + C!VDP ;

: SPRITE ( color char n -- )
 4 * 770 + SWAP 128 + OVER C!VDP
 1+ C!VDP ;
 
: LOCATE ( col row n -- )
 4 * 768 + SWAP OVER SWAP 1- SWAP C!VDP 1+ C!VDP ;

: PATTERN ( n addr -- )
 SWAP 8 * 1024 + 8 VMBW ;

: RAND ( n -- n )
 SEED @ 28645 U* DROP 31417 + DUP SEED !
 U* SWAP DROP ;

: CHAR-DEF ( w4..w1 addr -- )
 4 0 DO SWAP OVER ! 2 + LOOP DROP ;

: DELAY ( n -- )
 0 TIMER !
 BEGIN DUP TIMER @ < UNTIL DROP ;

: ALIGN HERE =CELLS DP ! ;

: ," 34 WORD HERE C@ 1+ ALLOT ALIGN ; IMMEDIATE

CREATE2 TXT 10 ALLOT
: (TXT")
 R> DUP DUP C@ 1+ DUP ROT + >R
 TXT SWAP CMOVE ;
: TXT" STATE @
 IF COMPILE (TXT") 34 WORD HERE DUP
 C@ 1+ =CELLS DUP 1- ROT C! ALLOT
 ELSE 17 MESSAGE ENDIF ; IMMEDIATE

: (S") R> DUP DUP C@ + >R
 1+ DUP 1+ SWAP C@ ;
: S" ( -- addr count )
 STATE @ IF
   COMPILE (S") HERE 1 DP +!
   34 WORD HERE C@ 2 + =CELLS DUP 1- ALLOT
   SWAP C!
 ELSE 17 MESSAGE ENDIF ; IMMEDIATE


( *************************** MAIN )

: RED ( -- ) ;
: BLUE ( n -- n ) 24 + ;
: GREY ( n -- n ) 48 + ;

128 CONSTANT INFANTRY
129 CONSTANT TANK
130 CONSTANT CITY
131 CONSTANT BASE2
200 CONSTANT PLAIN
201 CONSTANT WOOD
202 CONSTANT MOUNTAIN
CREATE2 PAT 8 ALLOT

0 VARIABLE V1
0 VARIABLE V2
32 VARIABLE MAP-WIDTH
24 VARIABLE MAP-HEIGHT
0 VARIABLE MAP
0 VARIABLE OFFX
0 VARIABLE OFFY
9 VARIABLE CURSX
9 VARIABLE CURSY
0 VARIABLE EXIT

: UNIT-DEF ( unit w4..w1 -- )
 PAT CHAR-DEF
 DUP RED PAT CHAR
 BLUE PAT CHAR ;

: BUILDING-DEF ( building w4..w1 -- )
 PAT CHAR-DEF
 DUP RED PAT CHAR
 DUP BLUE PAT CHAR
 GREY PAT CHAR ;

: TERRAIN-DEF ( terrain w4..w1 -- )
 PAT CHAR-DEF PAT CHAR ;

HEX
: PATS-DEF ( -- )
 0 81FF 8181 8181 FF81 PAT CHAR-DEF PAT PATTERN
 F 0 0 SPRITE
 INFANTRY 2828 1C10 1810 0018 UNIT-DEF
 TANK 7E00 7E81 1E24 0000 UNIT-DEF
 CITY 557F 577D 577D 0070 BUILDING-DEF
 BASE2 4A7E 7E4A 1010 0008 BUILDING-DEF
 19 10 COLOR
 19 11 COLOR
 19 12 COLOR
 17 13 COLOR
 17 14 COLOR
 17 15 COLOR
 1E 16 COLOR
 1E 17 COLOR
 1E 18 COLOR
 PLAIN 0000 0000 0000 0000 TERRAIN-DEF
 WOOD 4A40 FFEA 5FFF 000A TERRAIN-DEF
 MOUNTAIN BF00 DFBF 74EE 0020 TERRAIN-DEF
 C3 19 COLOR ;

: INIT-COLORS ( -- )
 1C 7 C!REG
 10 4 DO 1E I COLOR LOOP ;

DECIMAL

: TERR-TYPE-ID C@ ;
: TERR-DEFENSE 1+ C@ ;
: TERR-TEXT 2 + @ ;
4 CONSTANT TERR-TYPE-SIZE
CREATE2 TERR-TYPES TERR-TYPE-SIZE 5 * ALLOT

: CREATE-TERR-TYPE ( addr count b b i -- addr )
 TERR-TYPE-SIZE * TERR-TYPES + DUP V1 !
 2 0 DO DUP ROT SWAP C! 1+ LOOP
 ROT 1- ROT DROP SWAP ! V1 @ ;

: TERR-ID-ID C@ ;
: TERR-TYPE 2+ @ ;
4 CONSTANT TERR-ID-SIZE
CREATE2 TERR-IDS TERR-ID-SIZE 9 * ALLOT

: ADD-TERR-ID ( addr b i )
 TERR-ID-SIZE * TERR-IDS +
 SWAP OVER C! 2 + ! ;  

0 CONSTANT FOOT
1 CONSTANT MECH
2 CONSTANT WHEELS
3 CONSTANT TRACK
4 CONSTANT AIR
5 CONSTANT SHIP
6 CONSTANT SHIP-TRANS

: UNIT-TYPE-ID C@ ;
: UNIT-TYPE-COST 1+ C@ ;
: UNIT-TYPE-MOVES 2 + C@ ;
: UNIT-TYPE-MOVE 3 + C@ ;
: UNIT-TYPE-VISION 4 + C@ ;
: UNIT-TYPE-GAS 5 + C@ ;
: UNIT-TYPE-MUNITIONS 6 + C@ ;
: UNIT-TYPE-TEXT 8 + @ ;
10 CONSTANT UNIT-TYPE-SIZE
CREATE2 UNIT-TYPES UNIT-TYPE-SIZE 2 * ALLOT

: CREATE-UNIT-TYPE ( addr count b b b b b b b i -- )
 UNIT-TYPE-SIZE * UNIT-TYPES +
 7 0 DO DUP ROT SWAP C! 1+ LOOP
 ROT 1- ROT DROP SWAP 1+ ! ;

: UNIT-TYPE @ ;
: UNIT-HP 2 + @ ;
: UNIT-GAS 3 + @ ;
: UNIT-MUNITIONS 4 + @ ;
6 CONSTANT UNIT-SIZE
 
: CREATE-UNIT ( type-pointer ) ;

: CREATE-TYPES
 S" PLAIN" 1 PLAIN 0 CREATE-TERR-TYPE
 PLAIN 0 ADD-TERR-ID
 S" WOOD" 2 WOOD 1 CREATE-TERR-TYPE
 WOOD 1 ADD-TERR-ID
 S" MOUNTAIN" 4 MOUNTAIN 2 CREATE-TERR-TYPE
 MOUNTAIN 2 ADD-TERR-ID
 S" CITY" 3 CITY 3 CREATE-TERR-TYPE
 DUP CITY RED 3 ADD-TERR-ID
 DUP CITY BLUE 4 ADD-TERR-ID
 CITY GREY 5 ADD-TERR-ID
 S" BASE" 3 BASE2 4 CREATE-TERR-TYPE
 DUP BASE2 RED 6 ADD-TERR-ID
 DUP BASE2 BLUE 7 ADD-TERR-ID
 BASE2 GREY 8 ADD-TERR-ID

 S" INFANTRY" 0 99 2 FOOT 3 1 INFANTRY 0 CREATE-UNIT-TYPE
 S" TANK" 9 70 3 TRACK 6 7 TANK 1 CREATE-UNIT-TYPE ;

: SAVE-MAP ( -- )
 MAP @ MAP-WIDTH @ MAP-HEIGHT @ * 100
 DUP SCR ! BLOCK
 DUP MAP-WIDTH @ SWAP !
 2 + DUP MAP-HEIGHT @ SWAP !
 2 + SWAP CMOVE UPDATE FLUSH ;

: LOAD-MAP ( block# -- width height addr )
 BLOCK DUP @ MAP-WIDTH !
 2 + DUP @ MAP-HEIGHT !
 2 + MAP ! ;

: SHOW
 ( 20 * 24 )
 24 0 DO
   I OFFY @ + MAP-WIDTH @ * OFFX @ + MAP @ +
   I 32 * 20 VMBW
 LOOP ;

: SCROLL ( x y -- )  
 OFFX @ V1 ! OFFY @ V2 !
 OFFY @ + DUP DUP 0< 0= SWAP MAP-HEIGHT @ 24 - < AND IF
   OFFY ! ELSE DROP ENDIF
 OFFX @ + DUP DUP 0< 0= SWAP MAP-WIDTH @ 20 - < AND IF
   OFFX ! ELSE DROP ENDIF
 OFFX @ V1 @ = 0= OFFY @ V2 @ = 0= OR IF
   SHOW
 ENDIF ;

: MOVE ( x y -- )
 CURSY @ + DUP DUP 0< 0= SWAP 24 < AND IF
   CURSY ! ELSE DROP ENDIF
 CURSX @ + DUP DUP 0< 0= SWAP 20 < AND IF
   CURSX ! ELSE DROP ENDIF  
 CURSX @ 8 * CURSY @ 8 * 0 LOCATE ;

: KEY-ACTION ( c -- )
 DUP 72 = IF ( H : SCROLL LEFT )
   -1 0 SCROLL
 ENDIF
 DUP 75 = IF ( K: SCROLL RIGHT )
   1 0 SCROLL
 ENDIF
 DUP 81 = IF ( Q: QUIT )
   TRUE EXIT !
 ENDIF
 DUP 8 = IF ( CURSOR LEFT )
   -1 0 MOVE
 ENDIF
 DUP 9 = IF ( CURSOR RIGHT )
   1 0 MOVE
 ENDIF
 DUP 10 = IF ( CURSOR DOWN )
   0 1 MOVE
 ENDIF
 DUP 11 = IF ( CURSOR UP )
   0 -1 MOVE
 ENDIF
 DROP ;

0 VARIABLE KEY-DELAY
: TI-WARS
 FALSE EXIT !
 100 LOAD-MAP
 CLS GMODE
 INIT-COLORS
 PATS-DEF
 SHOW
 0 0 MOVE
 10 DELAY
 BEGIN
   0 ?KEY DUP IF
     1 = IF
       0 TIMER ! 10 KEY-DELAY ! TRUE
     ELSE
       TIMER @ KEY-DELAY @ > DUP IF
         0 TIMER ! 2 KEY-DELAY !
       ENDIF
     ENDIF
     IF KEY-ACTION ELSE DROP ENDIF
   ELSE
     DROP DROP
   ENDIF    
 EXIT @ UNTIL ;

 

Link to comment
Share on other sites

I've got my 2nd prize, a 250k RAMdisk!

 

Also, I've made one small note: if there isn't at least six entries to the contest, we won't be awarding prizes, just ranking entries.

 

Given that the prizes are material items of not-negligible worth, we don't want to award them if an entry had few or even no competition.

 

Adamantyr

Link to comment
Share on other sites

Oh, and since it's open to all TI-99/4a languages...

 

I keep hearing how Forth is the greatest language platform on the TI ever made... well, it's showtime, Forthies! :)

 

Adamantyr

 

Seen some action here... TI Wars in Forth... anyone else going to show us what Forth can do? :)

 

Adamantyr

Link to comment
Share on other sites

Oh, and since it's open to all TI-99/4a languages...

 

I keep hearing how Forth is the greatest language platform on the TI ever made... well, it's showtime, Forthies! :)

 

Adamantyr

I guess you might have to change one of the contest guidelines then

 

  • Must be loadable with BASIC, Extended BASIC or the Editor/Assembler cartridge

;)

Link to comment
Share on other sites

Oh, and since it's open to all TI-99/4a languages...

 

I keep hearing how Forth is the greatest language platform on the TI ever made... well, it's showtime, Forthies! :)

 

Adamantyr

I guess you might have to change one of the contest guidelines then

 

  • Must be loadable with BASIC, Extended BASIC or the Editor/Assembler cartridge

;)

 

Because... what, the new Forth comes on a cartridge?

 

Adamantyr

Link to comment
Share on other sites

Oh, and since it's open to all TI-99/4a languages...

 

I keep hearing how Forth is the greatest language platform on the TI ever made... well, it's showtime, Forthies! :)

 

Adamantyr

I guess you might have to change one of the contest guidelines then

 

  • Must be loadable with BASIC, Extended BASIC or the Editor/Assembler cartridge

;)

 

Because... what, the new Forth comes on a cartridge?

 

Adamantyr

Yep !?

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Quick update... I have been paying attention. :) It's good to see some entries in the works... since summer is a long time and we're all going to be doing stuff outdoors a lot, I thought I'd extend the contest a few months to September 1st.

 

Adamantyr

 

Good, now I have more chances to finish it in time.

I spent only 2 hours on my game in the last 6 weeks. :|

Link to comment
Share on other sites

I was wondering if that game must be single player to qualify.

 

The rules in the first post of this thread make no mention of the game being limited to single player only. If you have a multi-player game (either on the same computer or via the serial port) then I don't see why that would be a problem, and depending on your game, it would probably be desirable.

Link to comment
Share on other sites

Quick update... I have been paying attention. :) It's good to see some entries in the works... since summer is a long time and we're all going to be doing stuff outdoors a lot, I thought I'd extend the contest a few months to September 1st.

 

Adamantyr

 

what a good news... maybe need to rename to "snowy day game contest" :P ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...