Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming a game together-challenge
#1
Rules: everyone can add 20 lines to this code, comments SUB/Funcs start-stop doesn't count. Here's a start:

Some one else must have made an addition before you can make a nother one.

Code:
DECLARE SUB drawSprite (spr AS INTEGER, x AS INTEGER, y AS INTEGER) '1
SCREEN 7 '2

'************************
'Variables/Constants:
'------------------------
CONST numOfSprites = 1 '3

DIM SHARED sprites(numOfSprites - 1, 7, 7) AS INTEGER '4
CONST sprCarNorth = 0 '5

'************************
'Read graphics:
'------------------------
FOR spr = 1 TO numOfSprites '6
FOR y = 0 TO 7 '7
  FOR x = 0 TO 7 '8
   READ sprites(spr - 1, x, y) '9
NEXT x, y, spr '10

'************************
'Main loop here:
'------------------------

DO '11
k$ = INKEY$ '12

WAIT &H3DA, 8 '13
drawSprite sprCarNorth, 150, 100 '14

LOOP UNTIL k$ = CHR$(27) '15


'************************
'Graphics:
'------------------------

'*** Car:
' 16:
DATA -1,4,4,4,4,4,4,-1,-1,-1,8,4,4,8,-1,-1,-1,-1,8,4,4,8,-1,-1,-1,-1,4,4,4,4,-1,-1,-1,-1,4,7,7,4,-1,-1,-1,8,8,4,4,8,8,-1,-1,8,8,12,12,8,8,-1,-1,-1,12,12,12,12,-1,-1

SUB drawSprite (spr AS INTEGER, x AS INTEGER, y AS INTEGER)
FOR i = 0 TO 7 '17
  FOR j = 0 TO 7 '18
   IF sprites(spr, i, j) <> -1 THEN PSET (i + x, j + y), sprites(spr, i, j)'19
NEXT j, i '20
END SUB

Let's see what we end up with.

/Zap
url=http://www.copy-pasta.com]CopyPasta[/url] - FilePasta
Reply


Messages In This Thread
Programming a game together-challenge - by Zap - 07-17-2003, 03:08 PM
Yeah - by Zap - 07-19-2003, 09:20 PM
Programming a game together-challenge - by Zap - 07-21-2003, 08:33 PM
Programming a game together-challenge - by barok - 07-23-2003, 06:53 AM
Programming a game together-challenge - by oracle - 07-23-2003, 08:17 AM
Programming a game together-challenge - by Zap - 07-23-2003, 12:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)