Hrdlr - A hurdling game


#1

My first Arduboy game. I completed it a while ago but forgot to post it here.

Video:

Blog post with a bit more info:

http://odindutton.com/hrdlr-arduboy/

The code:

Enjoy!


(Mike McRoberts) #2

Thanks for this. It is very similar to a game called Hurdle Hopper I wrote for the ZX81 a LONG time ago that got published in one of the Sinclair magazine of the time (Giving my age away now).


(Scott) #3

@twe4ked,

It looks like you’ve developed this game using PlatformIO. It won’t compile under the Arduino IDE.

I forked you repository and made changes so it would compile in the Arduino IDE. I also converted it to use the Arduboy2 and ArduboyPlaytune libraries since the original Arduboy library is no longer being developed.

If you wish, I can create a pull request from my fork to your repository. My fork is here:


(Holmes) #4

If you make a .arduboy package, I would love to host it on my online repository.


(Phil Graham) #5

I tried to install it but there’s no ino file. How do I install it?


(Scott) #6

@phil8715, Did you read my post, 2 posts above yours?


(Phil Graham) #7

I did download your version.

I went into the hdlr folder and there’s an ino file but it’s only 1kb.

Tried to upload it and failed


(Scott) #8

@phil8715, That small hrdlr.ino file is fine. You need to put all the other .h files in your hurdlr folder along with the hrdlr.ino file. If you still have trouble, post the errors.


#9

@MLXXXp Thanks for doing that! I’ll be happy to accept a PR if it still works with PlatformIO. If not I can add a link from my README to your version if people need it.

@crait I’ll take a look into adding a .arduboy package file.

Thanks all!


#10

@phil8715 if you’re on a UNIX system you should be able to install PlatformIO and then install the Arduboy lib and run make upload to install it on your device. If not as @MLXXXp said, you could try his fork. Good luck!


(Scott) #11

I tried not to do anything that would prevent it working on PlatformIO but I don’t use PlatformIO so I haven’t tried it. If you could try my code to see if it works I can make a pull request. If it doesn’t we could try to figure out why.


(Phil Graham) #12

I’m getting his error.

Arduino: 1.8.1 (Windows 10), Board: “Arduino Leonardo”

C:\Users\philg\AppData\Local\Temp\ccs4gu8Q.ltrans0.ltrans.o: In function `setup’:

C:\Users\philg\Documents\Arduino\hrdlr-arduboy\hrdlr/hrdlr.ino:5: undefined reference to `gameSetup()’

C:\Users\philg\AppData\Local\Temp\ccs4gu8Q.ltrans0.ltrans.o: In function `loop’:

C:\Users\philg\Documents\Arduino\hrdlr-arduboy\hrdlr/hrdlr.ino:9: undefined reference to `gameLoop()’

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Leonardo.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


(Scott) #13

@phil8715, does the hrdlr folder contain all these files?:

hrdlr.ino
hurdle.h
banner.h
coin.h
game.cpp
game.h
music.h
player.h
speaker.h


(Phil Graham) #14

It contains all those files but they are in alphabetical order.

What I’m thinking is the main folder has other stuff in such as an assets folder an hrdlr folder then various files such as platformio.ini, banner.png.

Do I delete the other stuff and leave just the hrdlr folder that contains the ino file?


(Phil Graham) #15

I also noticed that the folder name didn’t match the ino name. I made it right, but it still didn’t run.


(Scott) #16

You should:

  1. Close the Arduino IDE.
  • Delete all hrdlr related folders and their contents from the Arduino folder in your Documents folder.

  • Download hrdlr-arduboy-master.zip from here to your Downloads folder using the green Clone or download button and selecting Download ZIP.

  • Unzip or extract the hrdlr-arduboy-master.zip file that you downloaded.

  • Open the hrdlr-arduboy-master folder that was created. In there, there will be a hrdlr folder.

  • Copy or move the hrdlr folder and all of its contents to your Arduino folder in your Documents folder.

  • If you wish, you can now delete the hrdlr-arduboy-master.zip file, and the hrdlr-arduboy-master folder and its contents, from you Downloads folder.


(Phil Graham) #17

Arduino: 1.8.1 (Windows 10), Board: “Arduino Leonardo”

sketch\game.cpp: In function ‘void handleInput()’:

game.cpp:91: error: ‘class Arduboy2Audio’ has no member named ‘toggle’

 arduboy.audio.toggle();

               ^

exit status 1
’class Arduboy2Audio’ has no member named ‘toggle’

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


(Scott) #18

Update to the latest 3.1.0 version of the Arduboy2 library using the Arduino Library Manager.


(Phil Graham) #19

updated the to the 3.1.0 Arduboy 2 library and that has fixed the problem. It’s now working fine.

Thanks @MLXXXp


(Kevin) #20

Nice work @twe4ked I’m a big fan of the title screen!