help with graphics
help with graphics
help im trying to make an rpg but my graphics are worse than the first pacman can someone tell me how to make a graphics loading program so i can just load my graphics
Code: Select all
DEFINT A-Z
TYPE BMPHeaderType
ID AS STRING * 2
Size AS LONG
RSV1 AS INTEGER
RSV2 AS INTEGER
offset AS LONG
HORZ AS LONG
WID AS LONG
HEI AS LONG
PLANES AS INTEGER
BPP AS INTEGER
COMPRESSION AS LONG
IMAGESIZE AS LONG
xRes AS LONG
yRes AS LONG
CLRUSED AS LONG
CLRIMPORT AS LONG
Pal AS STRING * 1024
END TYPE
DECLARE SUB LoadBMP (DestSeg%, SegxRes%, SegyRes%, File$, sX%, sY%, SwitchPal%, Trans%)
CLS : SCREEN 13
LoadBMP &HA000, 320, 200, "MyPic.BMP", 0, 0, 1, -1
'&HA000 = Video Segment, the segment of the screen
'320 and 200 is the resolution of the videosegment, in screen 13
'"MyPic.BMP" is just a BMP file, must be 256 color
'0, 0 is the top, left location to start drawing the image from
'1 is if it should change the palette to that in the BMP (0 is no)
'-1 is the color to treat as transperent, -1 means all will be drawn
SUB LoadBMP (DestSeg%, SegxRes%, SegyRes%, File$, sX, sY, SwitchPal%, Trans%)
DIM bmp AS BMPHeaderType
f% = FREEFILE
OPEN File$ FOR BINARY AS #f%
GET #f%, , bmp
IF SwitchPal% THEN
pall$ = bmp.Pal
IF LEN(pall$) = 1024 THEN
OUT &H3C8, 0
FOR I% = 1 TO 1024 STEP 4
b% = ASC(MID$(pall$, I%, 1)) \ 4
g% = ASC(MID$(pall$, I% + 1, 1)) \ 4
r% = ASC(MID$(pall$, I% + 2, 1)) \ 4
OUT &H3C9, r%
OUT &H3C9, g%
OUT &H3C9, b%
NEXT I%
END IF
END IF
Byte$ = SPACE$(bmp.WID)
DEF SEG = DestSeg%
wide% = bmp.WID - 1
Hite% = bmp.HEI - 1
offs& = LOC(f) + 1
FOR y% = Hite% TO 0 STEP -1
IF sY + y >= 0 AND sY + y < SegyRes THEN
GET #f%, offs&, Byte$
FOR x% = 0 TO wide%
IF sX + x >= 0 AND sX + x < SegxRes THEN
c% = ASC(MID$(Byte$, x% + 1, 1))
IF c% <> Trans% THEN
POKE (sX% + x%) + (sY% + y%) * (SegxRes + 0&), c%
END IF
END IF
NEXT x%
END IF
offs& = offs& + bmp.WID
NEXT y%
CLOSE #f
DEF SEG
END SUB
Have fun.
Tip: Learn more programming before you try a RPG. If you can't make all parts of the game yourself, then don't even try to make it. Learn everything yourself first, only then can you ask other people.
Because I'm sure you wont understand anything of the code I posted. And if you do, why did you need me to post it in the first place?.
I have left this dump.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Hay, If you'd like some better graphics, and you know how to use MS Paint(meaning able to under stand pixal shading and mixing). You might like this type of code..
This is somthing like Scorpian in Robo Raider, ofcource I made him with LINE staments, I'd had him done faster this way(and alot better). This code should work so you can copy it, and I'm sure you can see what its doing, if not PM me... Or email, I can prob explain it.. I'm using this in SpaceWarp, so when ever Pete puts up the next mag, look at the Screens I sent in for it for a better example... Note: I added tracks in his treds to this pic..
you can also look at the x.t.r.GRAPHICS intro to BA-SIC MU-SIC II, that was DATA drawn,
PS: The code above is 10x10, use 20x20 or a lil higher for more texture room. It also helps to make a chart of all 256 colors, thats not hard if you know any bout FOR..NEXT, n some other minor codes..
Code: Select all
SCREEN 13
xl = 10: yl = 10
DATA 24,24,00,00,12,12,00,00,24,24
DATA 23,23,14,14,12,12,14,14,23,23
DATA 24,24,14,14,12,12,14,14,24,24
DATA 23,23,14,14,12,12,14,14,23,23
DATA 24,24,14,14,12,12,14,14,24,24
DATA 23,23,14,14,04,04,14,14,23,23
DATA 24,24,14,14,04,04,14,14,24,24
DATA 23,23,14,14,04,04,14,14,23,23
DATA 24,24,14,14,14,14,14,14,24,24
DATA 23,23,00,00,00,00,00,00,23,23
FOR y = 1 TO yl
FOR x = 1 TO xl
READ z
PSET (x, y),z
NEXT
NEXT
' Moves the picture out of the corner...
DIM scorpian(10 * 10) 'or 100 (10x10)=100
GET (1,1)-(10,10), scorpian
CLS
PUT (160,100), scorpian, PSET
you can also look at the x.t.r.GRAPHICS intro to BA-SIC MU-SIC II, that was DATA drawn,
PS: The code above is 10x10, use 20x20 or a lil higher for more texture room. It also helps to make a chart of all 256 colors, thats not hard if you know any bout FOR..NEXT, n some other minor codes..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Aye, thats y I wanted to know how to BSAVE n BLOAD in another topic. I set up 1 program to generate the DATA pics, N now thanks to (can't spell his username, the 1 with the blue neon grim reaper avatar) BSAVE them to outboard .GFX or I like using .XTR(get it?? never mind lol) and in my main program, BLOAD em in under 6 lines... Due to story line tho, I'm prob still going to have 2 chain SpaceWarp,. oh well.
Besides, DATA drawing is no diff than PP256, MS Paint, or other editors, cept you get to see what your drawing while you draw with 'em.
Besides, DATA drawing is no diff than PP256, MS Paint, or other editors, cept you get to see what your drawing while you draw with 'em.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Kill me? If he can find me, and he better bring a gun(dads a x-cop so I know load of self-defence stuff, even takin a gun away from ya)..
Also how I know how to send my Jeep into a sidewinder, anyone want to go for a ride with me in my feild?? Just don't ride with my dad in the Jeep, he does it faster than me (I try not to flip ).
I'll just use Nek,. just to be safe neway ..
Also how I know how to send my Jeep into a sidewinder, anyone want to go for a ride with me in my feild?? Just don't ride with my dad in the Jeep, he does it faster than me (I try not to flip ).
I'll just use Nek,. just to be safe neway ..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
Well I kinda like sodapop ! LOLOL
* Doesn't run for cover, will fight anyone/anything (thinking grim reaper here) even death till the death (although i'll probably loose that last one .
So SodaPop, still fizzin at your age? I know I am LOL..
* Doesn't run for cover, will fight anyone/anything (thinking grim reaper here) even death till the death (although i'll probably loose that last one .
So SodaPop, still fizzin at your age? I know I am LOL..
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com