Slowing down ??

Blitz3D Forums/Blitz3D Beginners Area/Slowing down ??

It's OK to load your your titlescreen in the function like you do, because it only occurs once during the game. You should however, free the image from memory (with FreeImage) at the end of your titlescreen function, because you are done using it.

However, as W pointed out, loading images (or any external files) in a function that is repeatedly called (like your drawenemy() and update() functions) is an extremely bad idea. You are calling those functions at the speed that your monitor updates (at least 50 times a second) and you are just filling up all the ram in your computer with useless images.

Move the loading routines to the beginning of the program and make their variable Global, so that you can use them in your functions. Like so:
Global enemyship = LoadImage ("C:\blitzpics\alien.jpg")


Also, where you place SetBuffer BackBuffer() is not of any real concern as long as it's after the Graphics call, but it doesn't need to be in your main game loop. Just move it to just before your game loop and everything will be fine.
Just so you realize it, you've already placed that command
BEFORE your game loop so there's no need to move it (Your ;Main game loop- comment is not in the correct place).

By the way, when posting code, use the forum tags: What are the forum codes?