05-30-2003, 06:13 AM
EDIT!!!
Anyways, yeah, here is my new problem. It works perfectly, that's not the problem. The problem is my jumping motion sucks penis. It's not nearly as smooth or whatnot as the side-scrolling is...
Anyways, yeah, here is my new problem. It works perfectly, that's not the problem. The problem is my jumping motion sucks penis. It's not nearly as smooth or whatnot as the side-scrolling is...
Code:
'$INCLUDE: 'dqb\directqb.bi'
CLS
CONST MANLEFT = 1, MANRIGHT = 0, layerBG = 1, layerItems = 2, layerCombo = 3
IF DQBinit(3, 0) THEN DQBclose: PRINT DQBerror$: END
DQBinstallKeyboard
DQBinitVGA
DQBclearLayer layerBG
DQBclearLayer layerItems
DQBclearLayer layerCombo
DIM man(322) AS INTEGER
DEF SEG = VARSEG(man(0))
BLOAD "guy.dat", VARPTR(man(0))
DEF SEG
Direction% = MANRIGHT
gravity% = 7
mass% = 4
velocity% = 350
jumping% = 0
x% = 15
y% = 150
t! = TIMER
DQBpaint layerBG, 0, 0, 77
DQBboxF layerBG, 0, 151, 320, 155, 120
DQBboxF layerBG, 0, 156, 320, 200, 2
DQBboxF layerItems, 20, 110, 36, 120, 1
DO
oldy% = y%
oldx% = x%
WAIT &H3DA, 8
DQBcopyLayer layerBG, layerCombo
DQBcopyTransLayer layerItems, layerCombo
newtimer! = TIMER
IF jumping% = 1 THEN
t2! = newtimer! - t! + 1
y% = inity% - (mass% * gravity%) + INT((mass% * gravity% * t2! * t2! * t2!) + velocity% / t2!) - velocity% + 1
IF y% >= inity% THEN
y% = inity%
jumping% = 0
t! = TIMER
END IF
END IF
IF DQBkey(1) THEN EXIT DO
IF DQBkey(75) AND x% > 0 THEN x% = x% - Speed%: Direction% = MANLEFT
IF DQBkey(77) AND x% < 303 THEN x% = x% + Speed%: Direction% = MANRIGHT
IF DQBkey(29) THEN Speed% = 2 ELSE Speed% = 1
IF DQBkey(72) AND jumping% = 0 THEN
inity% = y%
t! = TIMER
jumping% = 1
END IF
WAIT &H3DA, 8, 8
DQBmPut layerCombo, x%, y% - 19, VARSEG(man(162 * jumping%)), VARPTR(man(162 * jumping%)), Direction%
DQBcopyTransLayer layerCombo, VIDEO
LOOP
DQBremoveKeyboard
DQBclose
earn.