News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Axis cannot run properly in version 1.64P

Started by piamoo, December 04, 2014, 08:52:23 AM

Previous topic - Next topic

piamoo

Axis is one of the demo games in the projects package. This game run in retail version 1.64L without any problem. After I upgrade the retail version 1.64L to 1.64P, a problem appears. When I put the mouse cursor over the word "Start" and click, nothing happens. If I put the mouse cursor over the word "Quit", the game can end. Any other user also discovers the problem? Thanks.

kevin


  Had a quick look in todays build and it does indeed stop.  It turns out there's a GAMESTATE declaration missing from the declarations file. 

  When the START button is pressed, the program uses GameState_Start constant to init a new game, but that constant didn't actually exist.   So it looks like there's some strange fault in an older version that's since been fixed.. as for what exactly, i've no idea !

   Just replacing the gamestate constant with this seems to fix the problem

PlayBASIC Code: [Select]
   ; Game State Constants 
Constant GameState_Menu =AC(1)

Constant GameState_Start =AC(1) ;
Constant GameState_StartGame =AC(1)
Constant GameState_InPlay =AC(1)
Constant GameState_PlayerDead =AC(1)
Constant GameState_LevelUp =AC(1)
Constant GameState_GameOver =AC(1)
Constant GameState_Quit =AC(1)







piamoo

Thank you. Actually, I only know a little about programming.

I have one more question. When I compiled(F4), an EXE file appeared. Then I opened the Axis folder and double clicked this EXE file. The game could run. Then I copied this Axis folder to the desktop. Then I opened this Axis folder(on the desktop) and double clicked the EXE file. However, the game could not run properly(the screen became a black screen only). Can you tell me the reason? Thanks again.

kevin


QuoteCan you tell me the reason

no idea.


piamoo

Quote from: kevin on December 04, 2014, 11:52:29 AM

QuoteCan you tell me the reason

no idea.


Hi, I did these things later:

Then I uninstalled PlayBASIC. I installed the installation file of PlayBASIC retail version 1.64L. I pressed F4 to compile Axis to make an EXE file. I copied Axis folder to the desktop. I opened this folder and double clicked this new EXE file. This EXE file could run. The game could be played normally.

This EXE file produced by retail version 1.6L is okay. Therefore, there may be a bug in the EXE file produced by version 1.64P. Right? Therefore, there may be a bug in the upgrade file(retail version 1.64P). Right?

I hope that some other users may try to compile this game and can tell me whether they encounter the same problem. Thanks first.!!!!

kevin


   The program is missing a file when you move it, during start up the programe loads an animation using a relative path.  If the program "works" in V1.64L then it shouldn't, it should abort on the LoadNewImage when the file isn't trying to load is missing.   

  in the Animations.pba file there's the following line.

PlayBASIC Code: [Select]
   ; Explosion Frames ---------------------------------------
Dim Anim_Explosion(1)
LoadAnimToArray(Anim_explosion(),p$+"..\..\gfx\explosions.png",14,64,64,0)





  Notice how the path is relative and bellow (outside) of the Axis folder, so the program is sharing that media with some other example to save space i'd say. 



PlayBASIC Code: [Select]
   ; Explosion Frames ---------------------------------------
Dim Anim_Explosion(1)
LoadAnimToArray(Anim_explosion(),"gfx\explosions.png",14,64,64,0)





     Of course this means you'll have to copy the file explosions.png  from the  Projects/GFX into Projects/Games/Axis/GFX

   


piamoo

Hi, I understand now. Thank you very much.

Your explanation is very good and clear. I think that I will learn a lot about programming..yes!