Too lazy to finish


(spinal) #1

I’m far too lazy to finish coding my game, does anyone want to finish it for me?

https://t.co/nngvvT3Inj


(ET) #2

Looks Great!

Would love to see the code


(Kevin) #3

It looks great! What do you mean by finishing? Adding levels? @TEAMarg might be able to help!

I think if you release the source code it’s actually pretty good demo already, I think people will like it!


(spinal) #4

It’s looking a little better now compared to that clip…

[moved video to lead post]

It really just needs enemy collisions, keys+doors scattered about and some sort of boss level.

Credits so far -
Game concept by Pheonix from socoder.net
Most GFX - me
Snake sprites - @eggboycolor
Music - Jayenkai, founder of Socoder.net


(spinal) #5

For anyone wanting to take a look, here is the source…

http://socoder.net/uploads/124/Joe_Arduboy.zip

It’d be nice if someone continued the work, but don’t worry if it doesn’t get finished, it’s quite fun as it is…


(Kevin) #6

The video was auto playing in the two posts so I moved it up to the first post, this is awesome. I’m gonna write this in a blog post! :slight_smile:


(spinal) #7

…There’s a blog?!


(Kevin) #8

Indeed there is! And you’re in it!

https://arduboy.com/arduboy-wears-many-hats/


#9

That was tricky to find! Needs a big fat button on the home page somewhere :stuck_out_tongue:


(Kevin) #10

there is a item in the page navigation menu! :slight_smile:

we will feature it more once there is more content


#11

Hi spinal
I dont see in the source the library gfx
Do you have this file ?
Where can i get it?
Thanks in advance
Jean pierre


(spinal) #12

Sorry, I forgot to add it.

http://socoder.net/uploads/124/Joe_Arduboy.zip

It should be in there now.


(Scott) #13

If anyone is interested it continuing development using the Arduboy2 and ArduboyPlaytune libraries in place of the original Arduboy library, here’s a unified diff:

--- Joe.ino.org	2017-03-25 18:08:38.805891334 -0400
+++ Joe.ino	2017-03-25 18:18:01.141959402 -0400
@@ -1,4 +1,6 @@
-#include "Arduboy.h"
+#include <Arduboy2.h>
+#include <ArduboyPlaytune.h>
+
 #include "gfx.h"
 #include "music.h"
 #include "level.h"
@@ -20,9 +22,9 @@
 #define SKIPINTRO 1
 #define OUTPUTVIDEO 1
 
-Arduboy arduboy;
+Arduboy2Base arduboy;
+ArduboyPlaytune tunes(arduboy.audio.enabled);
 
-unsigned char * screenBuffer;
 byte sfxPos = 0;
 bool playSfx = false;
 const byte *SFX = 0;
@@ -128,23 +130,23 @@
 void setContrast(uint8_t contrast)
 {
   arduboy.LCDCommandMode();
-  SPI.transfer(0x81); // contrast command
-  SPI.transfer(contrast);
+  arduboy.paint8Pixels(0x81); // contrast command
+  arduboy.paint8Pixels(contrast);
   arduboy.LCDDataMode();
 }
 
 void fadeOut() {
   // set screen to funky settings to allow fade
   arduboy.LCDCommandMode();
-  SPI.transfer(0xD9); // charge time command
-  SPI.transfer(0x00); // 0 - 16
-  SPI.transfer(0x81); // contrast command
-  SPI.transfer(127);
-  SPI.transfer(0xdb); // VCOM deselect level mode
-  SPI.transfer(0x00); // set vcomh = 0.83 * VCC
-  SPI.transfer(0xa4); // set entire display on/off
-  SPI.transfer(0xa6); // set normal display
-  SPI.transfer(0xaf); // set display on
+  arduboy.paint8Pixels(0xD9); // charge time command
+  arduboy.paint8Pixels(0x00); // 0 - 16
+  arduboy.paint8Pixels(0x81); // contrast command
+  arduboy.paint8Pixels(127);
+  arduboy.paint8Pixels(0xdb); // VCOM deselect level mode
+  arduboy.paint8Pixels(0x00); // set vcomh = 0.83 * VCC
+  arduboy.paint8Pixels(0xa4); // set entire display on/off
+  arduboy.paint8Pixels(0xa6); // set normal display
+  arduboy.paint8Pixels(0xaf); // set display on
   arduboy.LCDDataMode();  
 
   for (int t = 127; t > 0; t -= 1) {
@@ -163,15 +165,15 @@
   }
   // restore screen settings to default
   arduboy.LCDCommandMode();
-  SPI.transfer(0xD9); // charge time command
-  SPI.transfer(0xF1); // 0 - 16
-  SPI.transfer(0x81); // contrast command
-  SPI.transfer(0xCF);
-  SPI.transfer(0xdb); // VCOM deselect level mode
-  SPI.transfer(0x40); // set vcomh = 0.83 * VCC
-  SPI.transfer(0xa4); // set entire display on/off
-  SPI.transfer(0xa6); // set normal display
-  SPI.transfer(0xaf); // set display on
+  arduboy.paint8Pixels(0xD9); // charge time command
+  arduboy.paint8Pixels(0xF1); // 0 - 16
+  arduboy.paint8Pixels(0x81); // contrast command
+  arduboy.paint8Pixels(0xCF);
+  arduboy.paint8Pixels(0xdb); // VCOM deselect level mode
+  arduboy.paint8Pixels(0x40); // set vcomh = 0.83 * VCC
+  arduboy.paint8Pixels(0xa4); // set entire display on/off
+  arduboy.paint8Pixels(0xa6); // set normal display
+  arduboy.paint8Pixels(0xaf); // set display on
   arduboy.LCDDataMode();  
 }
 
@@ -256,7 +258,7 @@
 
 void drawTile(int16_t x, int16_t y, const uint8_t *bitmap) {
   for (byte t = 0; t < 8; t++) {
-    screenBuffer[(x * 8) + (y * 128) + t] = pgm_read_byte(bitmap + t);
+    arduboy.sBuffer[(x * 8) + (y * 128) + t] = pgm_read_byte(bitmap + t);
   }
 }
 
@@ -264,14 +266,14 @@
   x+=1;
   for (byte t = 0; t < 8; t++) {
     if(y>0){
-      byte temp = screenBuffer[(x * 8) + ((y-1) * 128) + t];
+      byte temp = arduboy.sBuffer[(x * 8) + ((y-1) * 128) + t];
       byte myByte = (pgm_read_byte(bitmap + t)&0x0F)<<4;
-      screenBuffer[(x * 8) + ((y-1) * 128) + t] += myByte;
+      arduboy.sBuffer[(x * 8) + ((y-1) * 128) + t] += myByte;
     }
     if(y<8){
-      byte temp = screenBuffer[(x * 8) + (y * 128) + t];
+      byte temp = arduboy.sBuffer[(x * 8) + (y * 128) + t];
       byte myByte = (pgm_read_byte(bitmap + t)&0xF0)>>4;
-      screenBuffer[(x * 8) + (y * 128) + t] += myByte;
+      arduboy.sBuffer[(x * 8) + (y * 128) + t] += myByte;
     }
   }
 }
@@ -302,7 +304,7 @@
 
 void intro(){
   arduboy.invert(false);
-  arduboy.tunes.stopScore();
+  tunes.stopScore();
   arduboy.clear();
   gameMode = 1;
 }
@@ -310,12 +312,22 @@
 
 
 void setup() {
-  //arduboy.begin();
-  arduboy.beginNoLogo();
+  arduboy.begin();
   arduboy.setFrameRate(frameRate);
   // arduboy.clear();
-  screenBuffer = arduboy.getBuffer();
   arduboy.initRandomSeed();
+  
+  // audio setup
+  tunes.initChannel(PIN_SPEAKER_1);
+#ifndef AB_DEVKIT
+  // if not a DevKit
+  tunes.initChannel(PIN_SPEAKER_2);
+#else
+  // if it's a DevKit
+  tunes.initChannel(PIN_SPEAKER_1); // use the same pin for both channels
+  tunes.toneMutesScore(true);       // mute the score when a tone is sounding
+#endif
+
   gameMode = 0;
 
   joeFallSpeed = 0;
@@ -324,16 +336,16 @@
 /*
   arduboy.LCDCommandMode();
 
-  SPI.transfer(0xD9); // charge time command
-  SPI.transfer(0x00); // 0 - 16
-  SPI.transfer(0x81); // contrast command
-  SPI.transfer(127);
-
-  SPI.transfer(0xdb); // VCOM deselect level mode
-  SPI.transfer(0x00); // set vcomh = 0.83 * VCC
-  SPI.transfer(0xa4); // set entire display on/off
-  SPI.transfer(0xa6); // set normal display
-  SPI.transfer(0xaf); // set display on
+  arduboy.paint8Pixels(0xD9); // charge time command
+  arduboy.paint8Pixels(0x00); // 0 - 16
+  arduboy.paint8Pixels(0x81); // contrast command
+  arduboy.paint8Pixels(127);
+
+  arduboy.paint8Pixels(0xdb); // VCOM deselect level mode
+  arduboy.paint8Pixels(0x00); // set vcomh = 0.83 * VCC
+  arduboy.paint8Pixels(0xa4); // set entire display on/off
+  arduboy.paint8Pixels(0xa6); // set normal display
+  arduboy.paint8Pixels(0xaf); // set display on
 
   arduboy.LCDDataMode();
 */
@@ -341,9 +353,9 @@
 
 void playGame() {
   // keep the music going...
-  if (!arduboy.tunes.playing() && settings[_MUSIC] == 1) {
+  if (!tunes.playing() && settings[_MUSIC] == 1) {
     byte trackToPlay = pgm_read_byte(&tracker[trkNum]);
-    arduboy.tunes.playScore(track[trackToPlay]);
+    tunes.playScore(track[trackToPlay]);
     trkNum++;
     if (trkNum >= sizeof(tracker))trkNum = 2;
   }
@@ -387,7 +399,7 @@
 void playSFX() {
   if (playSfx == true && settings[_SFX] == 1) {
     if (pgm_read_byte(&SFX[sfxPos]) != 0xFF) {
-      arduboy.tunes.tone(pgm_read_byte(&SFX[sfxPos++]) * 2, 70); // SFX
+      tunes.tone(pgm_read_byte(&SFX[sfxPos++]) * 2, 70); // SFX
     } else {
       playSfx = false;
       sfxPos = 0;
@@ -447,11 +459,11 @@
 
   if(TVOUT){
     if(dimension==0){
-      Serial.write(screenBuffer, 128 * 8);
+      Serial.write(arduboy.sBuffer, 128 * 8);
     }else{
       // invert the screen data, because we cant send commands.
       for(int t=0; t<128*8; t++){
-        char s = ~screenBuffer[t];
+        char s = ~arduboy.sBuffer[t];
         Serial.write(&s,1);
       }
     }
@@ -765,4 +777,4 @@
 
 }
 
-
+