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
#2
Can I delete someone else's lines?
Antoni
Reply
#3
Yeah, 'cause the sprite blitter is too slow.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
Nath, my question was just theoretical, but you killed this thread... Big Grin
Antoni
Reply
#5
Hey, I didn't intend such a thing!
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#6
Could be, but you've done it anyways... Cry ... Big Grin

Yup, you can delete others lines. And, I know the sprite blitter's too slow, but I didn't thought it mattered too much, as some one else could change it.

/Zap
url=http://www.copy-pasta.com]CopyPasta[/url] - FilePasta
Reply
#7
C'mon guys, can't be that boring!
url=http://www.copy-pasta.com]CopyPasta[/url] - FilePasta
Reply
#8
you'd never get anything done, because people would be deleting everyone elses lines. and there's too much chaos. no paramaters.
Jumping Jahoolipers!
Reply
#9
Yeah, I think this challenge is a great idea, but lets set some objectives for it. Pacman clone or racing game? Let's hear some ideas.
Reply
#10
racing game..2d........
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)