PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Error in beta 4

When ever I run a file for the second time, ppl quits.

Ie I load simple2.ppl and click on run. It runs successfully. If I click on run a second time without any other changes, ppl quits imediately.

Running on a ipaq 2210
Yes, this is known bug of the PocketFrog engine which the GameAPI uses. We can't seem to figure it out right now, we are still trying to make it work. Keep in mind, that most of game development will be done through the PIDE and that everytime you run PPL from the PIDE it quits after the program execution, therefore eliminating this behavior.

We will try to fix this for version 0.5, or later... :(

Regards,
Kornalius
When I trying to run this:
#include "gameapi.ppl"

func mainproc (hWnd$, Msg$, wParam$,lParam$)
ok$ = true;

case (Msg$)

WM_CLOSE:
shutgameapi(hWnd$);

WM_MOUSEMOVE:
movesprite(i$,LOWORD(lParam$), HIWORD(lParam$);

WM_KEYDOWN:
PostMessage(hWnd$, WM_CLOSE, 0, 0);

end;

return (ok$);

end;

func WinMain
h$=newform({Game}, {GAPIClass}, &mainproc;);
ShowWindow(h$, SW_SHOW);
ShowFPS(true, g_rgb(255,255,255));
InitGameAPI(h$, null, false);
Global (b$, i$);
b$ = loadsprite(apppath$+"WorldMap.jpg", -1, 1, 0, null);
i$ = loadsprite(apppath$+"sprite.jpg", rgb(255, 255, 255), 1, 0, null);
m$=loadsound(apppath$+"ars.mod", true);
playsound(m$);
return(true);
end;


I see nothing. Why? Is this code incorrect? Or what?
I doubt jpg files are supported in the GameAPI library. I never tried it myself, but other than that and that maybe the graphic files are not in the same directory of the .ppl application, your program is fine. Convert your graphic files to .PNG or .BMP instead. Try it again and let me know!

Regards,
Kornalius