GLBasic forum

Main forum => GLBasic - en => Topic started by: coder14 on 2011-Jun-10

Title: PeeJay's Highway game
Post by: coder14 on 2011-Jun-10
Hi guys! I was wondering if anyone could help me with the Highway game by PeeJay.

I downloaded the tutorial, and jumped straight to lesson 9 to give it a try - but no go.

First there was a syntax error - removed the comments - OK
Then wrong number of arguments in [playmusic] - commented out - precompile OK & compile starts
Then finally, this:
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.861
Wordcount:242 commands
compiling:
C:\DOCUME~1\SOFIA\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::LoadHiScore()':
C:\DOCUME~1\SOFIA\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:621: error: invalid initialization of reference of type 'DGNat&' from expression of type 'DGInt'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:1024: error: in passing argument 2 of `void __GLBASIC__::READLONG(DGNat, DGNat&)'
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.8 sec. Time: 20:56
Build: 0 succeeded.
*** 1 FAILED ***

Can anyone help, please?
Title: Re: PeeJay's Highway game
Post by: MrTAToad on 2011-Jun-10
It means the second variable in the READLONG command isn't an integer.  You need to find the variable declaration (if it exists) and put a % at the end of the variable name
Title: Re: PeeJay's Highway game
Post by: matchy on 2011-Jun-10
There is a variable that exists:

Code (glbasic) Select

GLOBAL hiscore%


Also, the media folder needs to be moved into the app folder.
Title: Re: PeeJay's Highway game
Post by: coder14 on 2011-Jun-10
It seems that the EXE in the [the game] folder works well, but the EXE as well as the GBAP in the [lesson9] folder doesn't.

After adding the % to the hiscore variable, the code compiles successfully, but just a blank "pulsating" screen appears when run.

Any ideas?
Title: Re: PeeJay's Highway game
Post by: okee on 2011-Jun-11
Like matchy said copy the media folder into the Lesson Nine.app folder
It'll overwrite the media folder in there and copy all the graphics etc into it
Title: Re: PeeJay's Highway game
Post by: coder14 on 2011-Jun-11
Thanks for the help you guys. Now it compiles and runs, but still no music.

Why does PLAYMUSIC "media/music.mid"  trigger this error:

wrong number of aguments : "PLAYMUSIC" called with 1 args. Required: 2 to 2 ??
Title: Re: PeeJay's Highway game
Post by: okee on 2011-Jun-11
should be
PLAYMUSIC "media/music.mid",TRUE

The midi doesn't seem to play on mine either, i can play it in windows media player but hear nothing in game.
If i replace it with an mp3 music file it plays no problem
Title: Re: PeeJay's Highway game
Post by: MrTAToad on 2011-Jun-11
It sounds like its a very old tutorial :)
Title: Re: PeeJay's Highway game
Post by: coder14 on 2011-Jun-11
Quote from: MrTAToad on 2011-Jun-11
It sounds like its a very old tutorial :)
If the syntax for PLAYMUSIC has changed and midi is no longer supported, it must be really old.

O_O But how is the compiled EXE in [the game] folder able to play the midi file?