Qbasicnews.com

Full Version: lame game wont work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
ok i know this isnt the best way to make a game, but why wont my sprite show up? im guessing it something simple.
Code:
SCREEN 13
DIM sprite(100)
DIM spritesh(100)
DIM tile1(100)
DIM tile2(100)
DIM tile3(100)
DIM map(10, 10)

spritex = 4
spritey = 5

FOR y = 1 TO 10
FOR x = 1 TO 10
READ srite
PSET (x, y), sprite
GET (1, 1)-(10, 10), sprite
NEXT
NEXT
SLEEP
FOR y = 1 TO 10
FOR x = 1 TO 10
READ sritesh
PSET (x, y), spritesh
GET (1, 1)-(10, 10), spritesh
NEXT
NEXT
SLEEP
FOR y = 1 TO 10
FOR x = 1 TO 10
READ tile1
PSET (x, y), tile1
GET (1, 1)-(10, 10), tile1
NEXT
NEXT
SLEEP
FOR y = 1 TO 10
FOR x = 1 TO 10
READ tile2
PSET (x, y), tile2
GET (1, 1)-(10, 10), tile2
NEXT
NEXT
SLEEP
FOR y = 1 TO 10
FOR x = 1 TO 10
READ tile3
PSET (x, y), tile3
GET (1, 1)-(10, 10), tile3
NEXT
NEXT

CLS
FOR y = 1 TO 10
FOR x = 1 TO 10

READ map(x, y)
IF map(x, y) = 1 THEN PUT (x * 10 - 10, y * 10 - 10), tile1
IF map(x, y) = 2 THEN PUT (x * 10 - 10, y * 10 - 10), tile2
IF map(x, y) = 3 THEN PUT (x * 10 - 10, y * 10 - 10), tile3
NEXT
NEXT

PUT (spritex * 10 - 10, spritey * 10 - 10), spritesh, AND
PUT (spritex * 10 - 10, spritey * 10 - 10), sprite, OR


DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,023,023,023,000,000,000,000,000
DATA 000,000,023,023,023,008,008,008,008,008
DATA 000,000,023,023,023,000,000,000,000,000
DATA 023,023,023,023,023,023,023,023,023,000
DATA 023,023,023,023,023,023,023,023,023,023
DATA 024,021,023,021,023,021,023,021,024,000
DATA 000,024,024,024,024,024,024,024,000,000

DATA 255,255,255,255,255,255,255,255,255,255
DATA 255,255,255,255,255,255,255,255,255,255
DATA 255,255,255,255,255,255,255,255,255,255
DATA 255,255,023,023,023,255,255,255,255,255
DATA 255,255,023,023,023,008,008,008,008,008
DATA 255,255,023,023,023,255,255,255,255,255
DATA 023,023,023,023,023,023,023,023,023,255
DATA 023,023,023,023,023,023,023,023,023,023
DATA 024,021,023,021,023,021,023,021,024,255
DATA 255,024,024,024,024,024,024,024,255,255
  
DATA 15,15,15,15,15,15,15,15,15,15
DATA 15,15,15,15,15,15,15,15,15,15
DATA 15,15,15,29,29,29,15,15,15,15
DATA 15,15,29,07,07,07,15,15,15,29
DATA 15,15,29,07,15,15,15,15,29,07
DATA 15,29,07,15,15,15,15,29,07,15
DATA 15,29,15,15,15,15,15,29,07,15
DATA 15,15,15,15,15,15,29,29,07,15
DATA 15,15,15,15,15,15,15,15,15,15                                        
DATA 15,15,15,15,15,15,15,15,15,15

DATA 10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,02,10,10,10,02,10,10
DATA 10,10,10,10,02,10,02,10,10,10
DATA 02,10,10,10,02,10,02,10,10,10
DATA 10,02,10,10,02,10,02,10,10,02
DATA 10,10,02,02,10,02,10,10,10,02
DATA 10,10,10,10,10,10,10,10,10,02
DATA 02,02,10,10,02,10,10,10,02,02
    
DATA 07,08,08,08,08,08,08,08,08,08
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07
DATA 08,07,07,07,07,07,07,07,07,07

    
DATA 2,2,1,1,3,1,1,1,1,1
DATA 2,2,1,1,3,1,1,1,2,2
DATA 1,1,1,1,3,3,1,1,2,1
DATA 3,3,3,1,1,1,2,2,2,1
DATA 1,1,1,1,1,3,3,2,2,1
DATA 1,2,3,1,1,1,1,2,1,1
DATA 2,2,3,1,1,3,3,3,1,1
DATA 2,2,2,1,1,1,1,1,1,3
DATA 2,2,3,1,1,2,2,1,1,3
DATA 3,3,3,1,1,2,2,3,3,3
Well... do you need all those SLEEP statements?
that was to test it
if you notice you dont see it pset the sprite
My guess?

Your dyslexia. Tongue



Look at your first READ statement.

PS: I'd suggest you do NEXT x, y instead of NEXT: NEXT... but that's just my suggestion..
....i am....thanks anyways
Second, too.

Both are srite and sritesh.
actualy the test said i wasn't . b's and d's can get confusing nut the cool thing is you can loos fous and see alot of things other people dont.
i can get the sprite to move. now i want t o put animation in, like firing rounds from the tank. how would i do this? i have treid get puts with for time = 1 to 10000000 : next but that is really slow and not flexibe with moving your sprite.

Anonymous

what kind of animation r u speaking of? like an explosion from the barrel, or more like just a single shot coming out?
because of the size i think just one shot, proalbe one or two pixles then have in move arcosse the screen untill it hits some thing then it blows it up.
Pages: 1 2 3 4