Game Design Music and Art

Blitzbasic Error i Think? – HoMeR

homer

Member

Posts: 106
From: sydney,nsw,australia
Registered: 07-22-2002
Hey I was reading This Tutorial From blitzbasic And it was telling Me how To use pictures bmp's, jpg's & png's But Everytime It Loads I get an Error "Illegal Memory Address" Does anyone Have Any idea What Im Doing Wrong Or Is It A Bug?


Thx HomeR

------------------
HoMaH :P

Ty

Member

Posts: 45
From: England
Registered: 05-15-2002
If you switch on "debug mode" from the "Program" menu, it should give you more details as to what the problem is. Sounds like if can't find the image to me.

Post some code and then I'll have a look if the debug tip doesn't help =)

------------------
Ty
~ I live to give

homer

Member

Posts: 106
From: sydney,nsw,australia
Registered: 07-22-2002
i tryied debug and it says my images dont exist they are in the same folder as my project thou

------------------
HoMaH :P

Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
Hiya,

Can you post your code on it? We can better help you diagnose that way

Thanks,

-Krylar

------------------

homer

Member

Posts: 106
From: sydney,nsw,australia
Registered: 07-22-2002
heres the code its actuly from you're tutorial krylar lol

Graphics 800, 600
SetBuffer BackBuffer ()
background = LoadImage ("bg.jpg")
player = LoadImage ("player.jpg")
MaskImage player, 255, 0, 255
x = 320
y = 340
Repeat
Cls
If KeyDown (203) Then x = x - 1 ; Left cursor
If KeyDown (205) Then x = x + 1 ; Right cursor
If KeyDown (200) Then y = y - 1 ; Up cursor
If KeyDown (208) Then y = y + 1 ; Down cursor
TileImage background
DrawImage player, x, y
DrawImage foreground, 0, 250
Flip
Until KeyHit (1)
End

------------------
HoMaH :P

homer

Member

Posts: 106
From: sydney,nsw,australia
Registered: 07-22-2002
nm i found my problem i didnt load a foreground image lolol

------------------
HoMaH :P

Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
hehe...it's almost ALWAYS the little oversights that'll get ya

Once spent nearly two weeks hunting for a bug only to find out that I had allocated 8 bytes fewer than I needed. Was an inconsistent crash that occured whenever I overran the memory addy. This was back in the DOS days with C, and before 32-bit extenders. Found the problem by luck, actually. Ah well...live and learn

-Krylar

------------------

c h i e f y

Member

Posts: 415
From: Surrey, United Kingdom
Registered: 03-07-2002
hey, who is into blitzbasic here on CCN?

if so, you must get this book that Krylar has ONLY just published called "Help with programming 2D blitz basic"

I have bought the book myself, it's top notch and comes with a CD full of source code

for more info www.blitzcoder.com/ubb/Forum3/HTML/000502.html

or simply got to the home page on blitzcoder check TOP RIGHT for a hyperlink - - > "help with 2D BB"

classic book on programming, if you're not programming in BB... WHY NOT ??

------------------
from your old mate
c h i e f y
global chiefy to yer old seadog seafarin' mateys

why not access chiefy's NEW worklogs ?