Posts: 719
Threads: 72
Joined: Mar 2003
you are free to use my sites upload and post the link to the file
http://alex.biotech-warfare.com/Upload.htm
then file will be saved in this directory:
http://alex.biotech-warfare.com/uploads/
oz~
Posts: 548
Threads: 67
Joined: Jun 2004
Thanks for the generous offer Oz, but I'll think I'll post here. Hope its okay if the code is 214 lines....
Code: DIM guy(50), guysh(50)
DIM sprite1(50), sprite2(50), sprite3(50)
DIM map1(21, 15)
SCREEN 13
guyx = 20
guyy = 8
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), sprite1
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), sprite2
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), sprite3
CLS
FOR y = 1 TO 15
FOR x = 1 TO 21
READ map1(x, y)
NEXT: NEXT
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), guy
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), guysh
CLS
FOR y = 1 TO 15
FOR x = 1 TO 21
IF map1(x, y) = 1 THEN PUT (x * 15 - 15, y * 13 - 13), sprite1
IF map1(x, y) = 2 THEN PUT (x * 15 - 15, y * 13 - 13), sprite2
IF map1(x, y) = 3 THEN PUT (x * 15 - 15, y * 13 - 13), sprite3
NEXT: NEXT
PUT (guyx * 15 - 15, guyy * 13 - 13), guysh, AND
PUT (guyx * 15 - 15, guyy * 13 - 13), guy, OR
DO
press$ = INKEY$
IF press$ = CHR$(0) + CHR$(75) AND map1(guyx - 1, guyy) <> 3 THEN
IF guyx > 1 THEN guyx = guyx - 1
END IF
IF press$ = CHR$(0) + CHR$(77) AND map1(guyx + 1, guyy) <> 3 THEN
IF guyx < 20 THEN guyx = guyx + 1
END IF
IF press$ = CHR$(0) + CHR$(72) AND map1(guyx, guyy - 1) <> 3 THEN
IF guyy > 1 THEN guyy = guyy - 1
END IF
IF press$ = CHR$(0) + CHR$(80) AND map1(guyx, guyy + 1) <> 3 THEN
IF guyy < 14 THEN guyy = guyy + 1
END IF
IF oldguyx <> guyx OR oldguyy <> guyy THEN
oldguyx = guyx
oldguyy = guyy
FOR y = 1 TO 15
FOR x = 1 TO 21
IF map1(x, y) = 1 THEN PUT (x * 15 - 15, y * 13 - 13), sprite1, PSET
IF map1(x, y) = 2 THEN PUT (x * 15 - 15, y * 13 - 13), sprite2, PSET
IF map1(x, y) = 3 THEN PUT (x * 15 - 15, y * 13 - 13), sprite3, PSET
NEXT: NEXT
PUT (guyx * 15 - 15, guyy * 13 - 13), guysh, AND
PUT (guyx * 15 - 15, guyy * 13 - 13), guy, OR
END IF
LOOP UNTIL press$ = CHR$(27)
'This the grass
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,02,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,02,10,10,10,10
DATA 10,10,10,02,10,10,10,02,10,10,02,10,10,10,10
DATA 10,10,10,10,02,10,02,10,10,10,10,10,10,10,10
DATA 02,10,10,10,02,10,02,10,10,10,02,10,10,10,10
DATA 10,02,10,10,02,10,02,10,10,02,10,10,02,10,10
DATA 10,10,02,02,10,02,10,10,10,02,10,02,10,10,10
DATA 10,10,10,10,10,10,10,10,10,02,10,02,10,10,10
DATA 02,02,10,10,02,10,10,10,02,02,02,10,10,10,10
DATA 10,10,02,02,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,02,02,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,02,10,10,10,10,10,10,10,10
'This is the fence
DATA 10,10,04,04,10,10,02,10,10,10,10,04,04,10,10
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 10,10,04,04,10,02,10,10,10,10,10,04,04,10,10
DATA 10,10,04,04,10,10,10,10,02,10,10,04,04,02,10
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 10,02,04,04,10,10,10,02,10,10,10,04,04,10,10
DATA 10,10,04,04,10,02,10,10,10,02,10,04,04,10,10
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04
DATA 10,10,04,04,02,10,02,10,10,10,10,04,04,10,10
DATA 02,10,04,04,10,10,10,10,02,02,10,04,04,10,02
'this is the map file, it goes after the stationary sprites
'and before the character sprite.
'Remember that 1 is the grass sprite and 2 is the fence.
'The map is 21 * 15.
DATA 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
DATA 00,00,00,00,00,00,10,10,10,10,00,00,00,00,00
DATA 00,00,00,00,00,10,10,10,10,10,10,00,00,00,00
DATA 00,00,00,10,10,66,10,10,10,10,10,66,00,00,00
DATA 00,00,15,00,00,66,66,66,66,66,66,66,00,00,00
DATA 00,00,00,00,00,00,66,00,66,00,66,00,00,00,00
DATA 00,00,00,00,00,00,66,66,66,66,66,00,00,00,00
DATA 00,00,00,00,00,00,00,66,00,66,00,00,00,00,00
DATA 00,00,00,00,00,00,02,02,02,02,02,00,00,00,00
DATA 00,00,00,00,00,02,00,02,02,02,00,02,00,00,00
DATA 00,00,00,00,00,02,00,02,02,02,00,02,00,00,00
DATA 00,00,00,00,00,66,00,02,02,02,00,66,00,00,00
DATA 00,00,00,00,02,00,00,07,00,07,00,00,02,00,00
DATA 00,00,00,00,00,02,02,02,00,02,02,02,00,00,00
'This is the mask for the sprite...
DATA 255,255,255,255,255,255,10,10,10,10,255,255,255,255,255
DATA 255,255,255,255,255,10,10,10,10,10,10,255,255,255,255
DATA 255,255,255,10,10,66,10,10,10,10,10,66,255,255,255
DATA 255,255,15,255,255,66,66,66,66,66,66,66,255,255,255
DATA 255,255,255,255,255,255,66,00,66,00,66,255,255,255,255
DATA 255,255,255,255,255,255,66,66,66,66,66,255,255,255,255
DATA 255,255,255,255,255,255,255,66,00,66,255,255,255,255,255
DATA 255,255,255,255,255,255,02,02,02,02,02,255,255,255,255
DATA 255,255,255,255,255,02,255,02,02,02,255,02,255,255,255
DATA 255,255,255,255,255,02,255,02,02,02,255,02,255,255,255
DATA 255,255,255,255,255,66,255,02,02,02,255,66,255,255,255
DATA 255,255,255,255,02,255,255,07,255,07,255,255,02,255,255
DATA 255,255,255,255,255,02,02,02,255,02,02,02,255,255,255
There. :rotfl:
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 2,765
Threads: 138
Joined: Nov 2002
Unless I miscounted you are reading 6 groups of DATA and there are only 5
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,616
Threads: 287
Joined: Jan 2003
I believe that Whitetiger is correct. Add another sprite of that size and you should be OK.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 548
Threads: 67
Joined: Jun 2004
thanks guys, it runs fine! So far as the engine. But my character sprite is cut in half! It's not really cut in half, the sprite is just split and both halfs are facing opposite directions like a symese twin. The reason why is I had to add an extra sprite but it has to be under the map DATA. There is only supposed to be two sprites under the map data, the character sprite and the charcter sprite's mask. If it isn't under the map data, it will come up with the same Out of Data error. Does anyone have a solution to this new problem at hand! Much appreciated.
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 2,765
Threads: 138
Joined: Nov 2002
I already helped you
there should be three above the map and two under
AND
you map it a row short
Code: DATA 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
DATA 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
try that
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 548
Threads: 67
Joined: Jun 2004
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 548
Threads: 67
Joined: Jun 2004
Can anybody help me!?
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 23
Threads: 4
Joined: Jun 2004
Try commenting out all of the reads except for one section. Test that the sprite is correct. If it looks like it's supposed to, then re-enable the next read. Test that sprite out. Keep going until you either bomb out or a sprite looks funny. If it's funny looking, then you've probably read too much in that loop and you can correct it. If it bombs, then you'll know where it's failing and which group of DATA statements are no good. Going section by section with any code always works best for me.
|