Problem Displaying Sprite


Imerion

Member
Joined
Feb 24, 2005
Messages
218
I tried to learn Phoenix with the aid of a DIV-Tutorial and some Fenix sources. However, I quickly encountered a program which I was unable to solve. The problem is that the car-sprite is not displayed. Any idea why? The code looks like this :

program car;

global

gfx;

private

begin

gfx=LOAD_FPG("C:/dev/fenix/bkg.fpg");

put_screen(gfx,001);

frame;


while (not key(_space))

frame;

end

end


process car();

private

begin

X=160;
Y=100;
graph=002;

loop

frame;

end

end

Any help would be appreciated!
 
If there should be a car create one! Fenix standard just runs the main code(the standard begin end) and then quits, unless something else is running. So try putting 'car()' before the loop in the main code and it will create an instance of the car process! And you might want to remove the preceding zero's in some numbers(001?).
 
I actually had "car();" above the While-command. Seems I missed printing it here though. What else could be wrong?
 
Tried that as well but it didn't help. Could it be that the background is drawn above the sprite?
 
Background is standard below all process' graphics, so that can't be it. Only thing I think can go wrong is that the graphics are not in the FPG?
 
Try removing the "frame;" below the put_screen command.
Maybe it does not help, but it`s not necessary.


Hmm, for me it display (tried the code with a own fpg),
but I added in a "set_mode(320,240,16);" at the begin.

So, if these won`t help, it`s your fpg
 
I found the error, and it was simpler than I though : There were no gfx at the number 2, instead it was located at 8 for some reason. Might be because I copied some pics back and forth. Anyway... sorry for asking when it was that simple. I really appreciate all your help.
 
Back
Top