Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
whats wrong with this code??
#11
it still wont work what should i do :???:
Reply
#12
Complete this checklist for me, as it will help:

[ ]1. Is the BMP exactly 320x200?

[ ]2. Is the 16x16 grass texture in the BMP in the TOP-LEFT corner?

[ ]3. Can't think of any more..

So?
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#13
1.) check
2.) check
Reply
#14
[syntax="qbasic"]
LoadBMP &HA000, 319, 199, "grass.bmp", 0, 0, 1, -1
GET (0, 0)-(15, 15), grass
CLS[/syntax]
Have you tried this?
Reply
#15
k it sorta worked but the grass tile has a pixel size of white above it or below it.


Code:
'Load the BMP
LoadBMP &HA000, 320, 200, "grass2.bmp", 0, 0, 1, -1

GET (0, 0)-(15, 15), grass
CLS
SCREEN 13

guyx = 4          'x,y corrdinates for sprite
guyy = 5


loadsprites        'loading sub

FOR y = 1 TO 12            'drawing map
FOR x = 1 TO 20

IF map1(x, y) = 1 THEN PUT (x * 16 - 16, y * 16 - 16), grass, PSET
IF map1(x, y) = 2 THEN PUT (x * 16 - 16, y * 16 - 16), wall, PSET
IF map1(x, y) = 3 THEN PUT (x * 16 - 16, y * 16 - 16), water, PSET
IF map1(x, y) = 4 THEN PUT (x * 16 - 16, y * 16 - 16), grassflag, PSET
NEXT x: NEXT y


whats wrong now
Reply
#16
Smile Alright, time for some good old debuging...

You know where you got the CLS? Just befor that type:

SLEEP

Just for awile to see what the loaded photo looks like.. got all that? It acts as a keypress wait, so after you press a key your code will continue, try it.. :wink: .. It may give you valiable feed back.
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#17
ah ok little screw up on the size of the picture now it works awsome thanks a ton. um as for loading other images do i have to add a whole nother bmp loader to load say a wall? or how else do it do it.
Reply
#18
Smile Just make all the tiles in one BMP, then GET each separet one. That will be the easiest way to do it.

But if you want separet BMPs,. you only need to put..

[syntax="qbasic"]LoadBMP &HA000, 320, 200, "grass.bmp", 0, 0, 1, -1

GET (0, 0)-(15, 15), grass
CLS
LoadBMP &HA000, 320, 200, "wall.bmp", 0, 0, 1, -1

GET (0, 0)-(15, 15), wall
CLS [/syntax]

No need to make another BMP loader, you can use the same one.. ^ See, its variables are set before it runs to what you want... its almost like a PRINT command, you don't need 2 QB IDEs to make 2 PRINT statments aye? :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)