QBASIC
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:QBASIC
sprites can be programmed using GET (x1,y1)-(x2,y2), array and displayed using PUT(x,y),array [,mode]
i suggest you to read the qbasic doc for those "functions" to get more info about it. one of my favourite technique is to have 2 arrays for one sprite: one made of the sprite using 0 as transparent color, and one mask that has 255 for transparent and 0 for solid pixels. Once you have them, you can use full 255 color sprites on full 256 colors background.
Just apply
i suggest you to read the qbasic doc for those "functions" to get more info about it. one of my favourite technique is to have 2 arrays for one sprite: one made of the sprite using 0 as transparent color, and one mask that has 255 for transparent and 0 for solid pixels. Once you have them, you can use full 255 color sprites on full 256 colors background.
Just apply
Code: Select all
PUT (x,y), background, PSET
x=newx
y=newy
GET (x,y)-(x+w,y+h), spr_background
PUT (x,y), spr_mask, AND
PUT (x,y), spr, OR
Re:QBASIC
i think you you made the .bas file using copy-paste so the basic source code seems like this:
[
GET (x,y)-(x+w,y+h), spr_backgroundPUT (x,y),spr_mask,ANDPUT (x,y), spr, OR
]
but not
[
GET (x,y)-(x+w,y+h), spr_background
PUT (x,y), spr_mask, AND
PUT (x,y), spr, OR
]
if so,try to chage it...
[
GET (x,y)-(x+w,y+h), spr_backgroundPUT (x,y),spr_mask,ANDPUT (x,y), spr, OR
]
but not
[
GET (x,y)-(x+w,y+h), spr_background
PUT (x,y), spr_mask, AND
PUT (x,y), spr, OR
]
if so,try to chage it...
Re:QBASIC
Here an example how to make sprites in qbasic:
Program 1: make a sprite and save it.
Program 2: loading a sprite from a file
Even today, I'm still working on Qbasic games.
Robin Gravel
Program 1: make a sprite and save it.
DIM Cube(1 TO 675)
SCREEN 1
LINE (140, 25)-(140 + 100, 125), 3, B
DRAW "C2 BM140,50 M+50,-25 M+50,25 M-50,25"
DRAW "M-50,-25 M+0,50 M+50,25 M+50,-25 M+0,-50 BM190,75 M+0,50"
GET (140, 25)-(240, 125), Cube
DEF SEG = VARSEG(Cube(1))
BSAVE "CUBEVIO.GRH", VARPTR(Cube(1)), 2700
DEF SEG
END
Program 2: loading a sprite from a file
Before i make AGI games, I make Qbasic games.DIM Cube(1 TO 675)
SCREEN 1
DEF SEG = VARSEG(Cube(1))
BLOAD "CUBEVIO.GRH", VARPTR(Cube(1))
DEF SEG ' Restituer le segment BASIC par d?faut.
PUT (80, 10), Cube
END
Even today, I'm still working on Qbasic games.
Robin Gravel
Re:QBASIC
Dreadwing, if you want to make anything in QBASIC, then you should know at least the basic commands, and when someone gives you an example, then go through it step by step, and when you don't understand something, then don't hesitate to ask... I see, that you don't understand absolutely anything from few last examples...