02-18-2005, 09:15 PM
DECLARE SUB PsetThere ()
DECLARE SUB Update (WhatToUpdate)
'EGA Sprite Editor - 16x16 Sprites
SCREEN 7
DIM SHARED Sprite%(1 TO 66)
DIM SHARED XPos%(1 TO 16)
DIM SHARED YPos%(1 TO 16)
DIM SHARED X%, Y%, iX%, iY%
DIM SHARED Colour%
XPos% = 1: YPos% = 1
X% = 10 + ((XPos% - 1) * 2)
Y% = 10 + ((YPos% - 1) * 2)
iX% = 49 + XPos%: iY% = 10 + YPos%
Colour% = 7
PAINT (0, 0), 1
FOR B% = 10 TO 42 STEP 2
FOR a% = 10 TO 42 STEP 2
PSET (a% + 1, B% + 1), 7
PSET (((a% - 10) / 2) + 50, ((B% - 10) / 2) + 11), 7
NEXT a%
NEXT B%
LINE (49, 10)-(67, 28), 15, B
Update 1
Update 2
WHILE INKEY$ = "": WEND
SUB Update (WhatToUpdate)
IF WhatToUpdate = 1 THEN
X% = 10 + ((XPos% - 1) * 2)
Y% = 10 + ((YPos% - 1) * 2)
iX% = 49 + XPos%: iY% = 10 + YPos%
LINE (X%, Y%)-(X% + 2, Y% + 2), 4, B
ELSE
LOCATE 1, 18: COLOR Colour%, 0: PRINT "COLOUR"
END IF
END SUB
------------------------------------------------------------------
I'm trying to make a sprite editor to help me making the sprites
for a game, but something is wrong... Check it, and see where the Selector goes... What's wrong here? Maybe a qbasic bug or what? Or I did an error? Please help!
DECLARE SUB Update (WhatToUpdate)
'EGA Sprite Editor - 16x16 Sprites
SCREEN 7
DIM SHARED Sprite%(1 TO 66)
DIM SHARED XPos%(1 TO 16)
DIM SHARED YPos%(1 TO 16)
DIM SHARED X%, Y%, iX%, iY%
DIM SHARED Colour%
XPos% = 1: YPos% = 1
X% = 10 + ((XPos% - 1) * 2)
Y% = 10 + ((YPos% - 1) * 2)
iX% = 49 + XPos%: iY% = 10 + YPos%
Colour% = 7
PAINT (0, 0), 1
FOR B% = 10 TO 42 STEP 2
FOR a% = 10 TO 42 STEP 2
PSET (a% + 1, B% + 1), 7
PSET (((a% - 10) / 2) + 50, ((B% - 10) / 2) + 11), 7
NEXT a%
NEXT B%
LINE (49, 10)-(67, 28), 15, B
Update 1
Update 2
WHILE INKEY$ = "": WEND
SUB Update (WhatToUpdate)
IF WhatToUpdate = 1 THEN
X% = 10 + ((XPos% - 1) * 2)
Y% = 10 + ((YPos% - 1) * 2)
iX% = 49 + XPos%: iY% = 10 + YPos%
LINE (X%, Y%)-(X% + 2, Y% + 2), 4, B
ELSE
LOCATE 1, 18: COLOR Colour%, 0: PRINT "COLOUR"
END IF
END SUB
------------------------------------------------------------------
I'm trying to make a sprite editor to help me making the sprites
for a game, but something is wrong... Check it, and see where the Selector goes... What's wrong here? Maybe a qbasic bug or what? Or I did an error? Please help!