PeeJay's Highway game

Previous topic - Next topic

coder14

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?

MrTAToad

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

matchy

There is a variable that exists:

Code (glbasic) Select

GLOBAL hiscore%


Also, the media folder needs to be moved into the app folder.

coder14

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?

okee

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
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

coder14

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 ??

okee

#6
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
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

MrTAToad

It sounds like its a very old tutorial :)

coder14

#8
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?