Switch to full style
Understanding the language, error messages, etc.
Post a reply

Re: seperate sketches for seperate game aspects

Sat Aug 20, 2016 1:20 pm

Oooooh, i think you forgot `extern Gamebuino gb;` (in the other files, that is) so that you can use gb.<stuff> in the other files!

Re: seperate sketches for seperate game aspects

Sat Aug 20, 2016 11:17 pm

Ok before I start driving myself nuts.......

Do I need the extern const byte sever_right[]; in the map.ino?

Do I need the extern const byte *spritesheet[]; in the player.ino?

Do I put both or one or the other in the Esmerelda.ino which has the void loop and setup?

Do I put the extern Gamebuino gb; in just the map.ino and the player.ino sketch?

Does the name of the loop matter for the player.ino and map.ino sketches?

My code is posted, have I got everything placed right in each sketch. Is something mixed up?

Please just take a look.

Re: seperate sketches for seperate game aspects

Sun Aug 21, 2016 12:29 am

You basically need an "extern <whatever that variable definition was>" in the file in which you want to use said variable.

Skimming over your code it seems to me as if map.ino needs gb and player.ino needs gb, player_x, player_y, player_direction

I might have missed some, but yeah, you need an "extern <whatever the variable definition was>" in the file if that variable was actually decalred in a different file
Post a reply