[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2012-11-14T03:12:55-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/3639 2012-11-14T03:12:55-05:00 2012-11-14T03:12:55-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=22210#p22210 <![CDATA[getting bulky sprite to move]]>
I have tried many methods, and this is my most recent. My other code (which I can post later), would draw the sprite in question, but when moving, it would simply give me an OUT OF DATA error. This most recent code, now tells me Subscript range. So it has to be something I am doing with the array and not understanding the concept.

I really appreciate any help given as it's driving me crazy!

(Shout out to Ted Felix for the bird sprite):

DIM xst AS INTEGER
DIM yst AS INTEGER
DIM count AS INTEGER
DIM count2 AS INTEGER
DIM bird(14, 14) REM honestly unsure of the bounds at this point
DIM letter AS STRING
REM variables dimmed early to avoid confusion

SCREEN 13

LET xst = 0
LET yst = 0
LET count = xst + 14
LET count2 = yst + 14
REM set them equal to a value to avoid confusion


DATA 00,00,00,00,00,00,00,00,00,00,12,12,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00,15,15,00,00,00
DATA 00,00,00,00,00,00,00,00,00,15,15,15,15,00,00
DATA 00,00,00,00,00,00,00,00,00,15,15,00,15,00,00
DATA 00,00,00,00,00,00,00,00,15,15,15,15,15,14,00
DATA 00,00,00,00,15,15,15,15,15,15,15,15,15,14,14
DATA 15,00,15,15,15,15,00,15,15,15,15,15,00,00,00
DATA 00,15,15,15,15,00,15,15,15,15,15,00,00,00,00
DATA 15,00,15,15,00,15,15,15,15,15,15,00,00,00,00
DATA 00,15,15,15,15,00,00,15,15,15,15,00,00,00,00
DATA 15,00,15,15,15,15,15,15,15,15,00,00,00,00,00
DATA 00,00,00,00,00,00,15,15,15,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,14,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,14,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,14,14,14,00,00,00,00,00,00
REM pixel from Ted Felix

FOR y = 0 TO 14
FOR x = 0 TO 14
READ bird(x, y)
NEXT x
NEXT y
REM stores the data read into an array of bird(x,y)

DO
letter = INKEY$
IF letter = "d" THEN
FOR y = yst TO count2
FOR x = xst TO count
PSET (x, y), bird(x, y)
NEXT x
NEXT y
LET xst = xst + 10
LET count = xst + 14
END IF
LOOP UNTIL INKEY$ = ""
REM unless esc is pressed, will continue in an idle state
REM or if d is pressed, object should theoretically move right

Statistics: Posted by qbasicisfun — Wed Nov 14, 2012 3:12 am


]]>