Pacman in CircuitBlocks

As I mentioned in my WIP-thread, Iā€™ve been working on and off on a Pacman clone in CircuitBlocks. The game is now finished!

Quick demo:

Whatā€™s your best score? Iā€™m unfortunately pretty bad at the game myselfā€¦ :joy:

As promised, hereā€™s the CircuitBlocks project file! Hopefully it can help someone get started. Feel free to change/copy/steal/do whatever with it. Happy hacking and if you end up modding/building something new based on this - please share :slight_smile:
PacMan.zip (299.7 KB)

Some things to note:

  • CircuitBlocks is not super performant with project files this bigā€¦ it works, but itā€™s quite slow
  • Thereā€™s currently no support for Arrays/Lists in CircuitBlocks which makes this project waaaay more complex than it should be :wink:
9 Likes

I know, I wish there were arrays in circuitblocks so thatā€™s why I switched to c++ for my bad game. I donā€™t even know how you managed but you did a great job! :+1:

Well done and thanks for sharing :slight_smile:

Weā€™ll share this on our social media channels if youā€™re ok with that

1 Like

Sure thing :slight_smile:

Hello
can it be compiled in latest CircuitBlocks?
For me it just spins in
ā€œCompiling sketchā€
Indefinitely ā€¦ :frowning:

Hi @tarzanek - yes it can be compiled in CircuitBlocks. Itā€™s a pretty big project file though, so some times CircuitBlocks struggles to deal with it. Iā€™ve noticed that if you click the ā€œOpen Codeā€ button it will sometimes show an empty code window - when that happens CircuitBlocks will fail to compile the project for you. The workaround is to open another project file and try to compile that, then go back to pacman.

Thnx @oscar , this works
what I also noticed is that this runs only on one cpu (hence the slowness)

@albertgajsak are above bugs in your fork or upstream? Can they be reported? (where? can you do it?)

@tarzanek I suspect itā€™s related to this Error in JS console on project load

1 Like

Hi there,

Thanks for reporting this. Weā€™ll put it on our to-do list and fix it as soon as possible. :slight_smile:

-Dorotea from CircuitMess

1 Like

how do i add this to my nibble

Hello!

You can download the zip Oscar provided in his original post and extract the contained XML file into the CIrcuitBlocks sketches directory (My Documents\CircuitBlocks). When you open CircuitBlocks, the sketch will be listed under Your sketches, where you can open it and run it on your Nibble.

Filip

1 Like

@oscar @filipCM when I download the file, it comes up as a zipped file. all good, right? then I moved the file into the Circuitblocks folder, under ā€œmy documentsā€. I extracted the file, and now it is a normal folder. But when I open the folder, it shows another folder and a microsoft edge tab. The tab looks like this:


Why isnā€™t it an XML file? Also, when I open Circuitblocks, the file isnā€™t under my sketches. Can you help me get it on my nibble?

Hey there!

What you are seeing is Edge trying to display the XML sketch as if it were an HTML webpage. Since you donā€™t have any other program for opening XML files on your computer, Windows automatically assumes it should be opened by Edge, thatā€™s why it is displayed as an Edge tab.

Please move the xml sketch into the CircuitBlocks directory. Your folder structure should be My Documents\CircuitBlocks\PacMan.xml
In other words, the file that is displayed as an Edge tab on your computer should be directly inside the CircuitBlocks directory.

Once you placed the sketch into the right folder, donā€™t open it directly. Instead, launch CircuitBlocks and the sketch should appear under Your sketches.

Let me know if this helps :slight_smile:

Filip

1 Like

@filipCM So when I download the file, it is downloaded as a .zip file. when I open it, it still shows the edge. if I download it, donā€™t touch it, and move it to the folder, open CircuitBlocks, it STILL isnā€™t there. Is there something wrong with my download type? Or do I need some form of software to make it download as a xml? Or is this just me?

Hey @BtTweeks,

Sorry to hear youā€™re still struggling to get it working. Please contact us with a screenshot of your CircuitBlocks sketches directory at contact@circuitmess.com and weā€™ll do our best to get you sorted out.

Filip

@filipCM Itā€™s ok with the download now. It is now in my circuitblocks folder, and running in the app itself. But, like with @tarzanek it just spins on ā€˜Compiling Sketchā€™ Forever. I tried to close and re-open it, but that didnā€™t work either. Next I tried to close and re-open it, then run only the sketch, but that didnā€™t work EITHER. So finally, I tried leaving it to compile the sketch overnight. The only thing that I achieved was a notification of a flat battery on my nibble. I have also tried the solution to tarzanekā€™s problem, but that only made my program lag out, and made the window give me the messge of ā€˜CircuitBlocks is not respondingā€™. Iā€™m confused as to why this is happening, as tarzanek found this to work. Should I try to just let it try to respond for a while, then try?

@BtTweeks That is some strange behavior from the app. Compiling can indeed take a long time on some machines, but not the whole night. Please try compiling that sketch again, and leave it compiling for at least 20/30 minutes. Then if it still isnā€™t done, stop the compilation by clicking the run button again, go back to the home screen, and send an error report. You can find the ā€œSend error reportā€ button at the very bottom of CircuitBlocks. Let me know your report ID so I can take a look at what is happening.

On a sidenote, weā€™re soon releasing a web browser-based version of CircuitBlocks with micropython instead of C, which will eliminate problems such as this one and drastically speed up running sketches on your devices.

Filip

how do you upload it on to the nibble