Join us on Discord!
You can help CodeWalrus stay online by donating here.

Don't Touch the Spikes CE Port [C]

Started by Unicorn, June 19, 2016, 01:16:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Unicorn

Hey everyone! I'm going to attempt to port the Don't Touch the Spikes iPhone/Android game.

Just a warning, it may not be exactly the same, but the game will have the same principle.

So far I have no progress, except for testing things out in basic, I was waiting to make sure the SC3 was up to date with the C libraries. Anyways I probably am going to have a hard time testing the program as there is no online CE emulator, but I think in a few days ill be able to download CEmu. If someone would like to test for me, please PM. :)

Also, the screen coords are 240x320 right?

Anyways, I hope to get something done. :D
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

That would be nice. Hopefully you can find a way to show screenshots in the future because I am curious about how it will look like :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

TheMachine02

Yeah, the screen is 320(x)x240(y). We usually also use 8bpp mode, cause it is faster to update. (Altough here you could use 16bpp, but almost all graphics function works in 8bpp anyway). Can't wait to see what you will get  :)

Dream of Omnimaga

Yep, same screen dimensions, but no 160x240 mode. Instead, we have 8 bpp like TheMachine02 says, as well as 16bpp. Most games use 8 bpp with custom palettes. You can also use 1, 2 and 4 bpp but the speed is pretty much the same as 8 bpp so it's not worth the quality drop.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

Since this got included in the Project of the month Award Poll, I figured I might as well work on it :P

Anyways, It won't be don't touch the spikes, it'll be don't touch the wrong color.



// Program Name:
// Author(s):
// Description:

/* Keep these headers */
#include <tice.h>

/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Other available headers */
// including stdarg.h, setjmp.h, assert.h, ctype.h, float.h, iso646.h, limits.h, errno.h

/* Available libraries */
// including lib/ce/graphc.h, lib/ce/fileioc.h, and lib/ce/keypadc.h
#include <lib/ce/graphx.h>
#include <lib/ce/keypadc.h>
/* Put your function prototypes here */
void setColors(int color1, int color2, int color3, int color4, int color5);
void draw(void);
void setColor(void);
void inGame(void);
/* Put all your globals here. */
int Gcolor1, Gcolor2, Gcolor3, Gcolor4, Gcolor5, key, colorChoice, keyPress;
bool quit, up, left = true;
/* Put all your code here */

void main() {
    srand( rtc_Time() );
    gfx_Begin(gfx_8bpp);
    gfx_FillScreen(181);
    gfx_PrintStringXY("Don't Touch the Wrong Color!",60,1);
    gfx_PrintStringXY("Press any key to play",85,11);
    while(kb_ScanGroup(kb_group_6) != kb_Clear) {
        if (key & kb_2nd) {
            gfx_FillScreen(181);
            setColors(31,255,95,236,186);
            draw();
inGame();
        }
if (quit == true)
break;
        key = kb_ScanGroup(kb_group_1);  //2nd
    }
    gfx_End();
    prgm_CleanUp();
}
void draw(void){
    setColor();
    gfx_FillRectangle(0, 0, 16, 60);
    setColor();
    gfx_FillRectangle(0, 60, 16, 60);
    setColor();
    gfx_FillRectangle(0, 120, 16, 60);
    setColor();
    gfx_FillRectangle(0, 180, 16, 60);
    setColor();
    gfx_FillRectangle(308, 0, 16, 60);
    setColor();
    gfx_FillRectangle(308, 60, 16, 60);
    setColor();
    gfx_FillRectangle(308, 120, 16, 60);
    setColor();
    gfx_FillRectangle(308, 180, 16, 60);
}
void setColor(void) {
    colorChoice = randInt(1,5);
    if (colorChoice == 1)
        gfx_SetColor(Gcolor1);
    if (colorChoice == 2)
        gfx_SetColor(Gcolor2);
    if (colorChoice == 3)
        gfx_SetColor(Gcolor3);
    if (colorChoice == 4)
        gfx_SetColor(Gcolor4);
    if (colorChoice == 5)
        gfx_SetColor(Gcolor5);
}
void setColors(int color1, int color2, int color3, int color4, int color5) {
    Gcolor1 = color1;
    Gcolor2 = color2;
    Gcolor3 = color3;
    Gcolor4 = color4;
    Gcolor5 = color5;
}
void inGame() {
int posX = 160, posY = 120;
while (kb_ScanGroup(kb_group_6) != kb_Clear) {
if (keyPress % 15 == 0) {
if (kb_ScanGroup(kb_group_7) == kb_Up)
up = true;
if (up == false)
posY = posY + 2;
if (up == true)
posY = posY - 2;
if (left == true)
posX = posX - 3;
if (left == false)
posX = posX + 3;
gfx_SetColor(181);
if (left == true && up == false)
gfx_FillCircle(posX+3, posY-4, 10);
if (left == true && up == true)
gfx_FillCircle(posX+3, posY-4, 10);
if (left == false && up == true)
gfx_FillCircle(posX-3, posY+4, 10);
if (left == false && up == false)
gfx_FillCircle(posX-3, posY+4, 10);
gfx_SetColor(Gcolor5);
gfx_FillCircle(posX, posY, 8);
if (left == true && gfx_GetPixel(posX-8, posY) != 181 && gfx_GetPixel(posX-8, posY) == Gcolor5)
left = false;
if (left == false && gfx_GetPixel(posX-8, posY) != 181 && gfx_GetPixel(posX-8, posY) == Gcolor5)
left = true;
if (left == true && gfx_GetPixel(posX-8, posY) != 181 && gfx_GetPixel(posX-8, posY) != Gcolor5)
break;
if (left == false && gfx_GetPixel(posX+8, posY) != 181 && gfx_GetPixel(posX+8, posY) != Gcolor5)
break;
}
keyPress++;
}
quit = true;
}
/* Other functions */


I've also made good use of that autotester that Adriweb made, and maybe later today I can fix the physics :P Cause after I get teh physics down, its just a matter of changing the colors every time you bounce back from a wall.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

Oooh, I like the idea. Pretty original actually, unless Don't Touch the Color actually exists, but even if it does it's nice to see one of the spinoff being ported instead. Anyway I can't wait to try it but it must be quite hard O.O
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

#6
Thanks! Since then I've actually made a lot of progress, I may even be just about done!
I've implemented high-scores, and every 6 points you get the color of your ball is changed. Every time you bounce off of both sides once, the colors are rearranged. Let me know what you think!

I'm planning to add a currency which you will be able to use to buy different backgrounds and character sprites, like a rectangle, or a star, or something. I probably will also add color changing options as well, sort of like in StackerCE.


// Program Name:
// Author(s):
// Description:

/* Keep these headers */
#include <tice.h>

/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <debug.h>
/* Other available headers */
// including stdarg.h, setjmp.h, assert.h, ctype.h, float.h, iso646.h, limits.h, errno.h

/* Available libraries */
// including lib/ce/graphc.h, lib/ce/fileioc.h, and lib/ce/keypadc.h
#include <lib/ce/graphx.h>
#include <lib/ce/keypadc.h>
#include <lib/ce/fileioc.h>
/* Put your function prototypes here */
void setColors(int color1, int color2, int color3, int color4, int color5);
void draw(void);
void setColor(void);
void inGame(void);
/* Put all your globals here. */
int Gcolor1, Gcolor2, Gcolor3, Gcolor4, Gcolor5,colorChange, key, time, random, colorChoice, keyPress, getPixelLeft, getPixelRight, score;
ti_var_t file;
uint8_t highscore;
bool quit, up, left = true, timer, userColor, userColor1;
/* Put all your code here */

void main() {
ti_CloseAll();
file = ti_Open("clrhs", "r");
if (file) {
ti_Read(&highscore, sizeof(highscore), 1, file);
    }   
    else {
    highscore = 0;
    }
    srand( rtc_Time() );
    gfx_Begin(gfx_8bpp);
    gfx_FillScreen(181);
    gfx_PrintStringXY("Don't Touch the Wrong Color!",60,1);
    gfx_PrintStringXY("Press any key to play",85,11);
gfx_PrintStringXY("Highscore:",105,51);
gfx_SetTextXY(180,51);
gfx_PrintInt(highscore, 3);
    while(kb_ScanGroup(kb_group_6) != kb_Clear) {
        if (kb_AnyKey()) {
            gfx_FillScreen(181);
            setColors(31,255,7,236,186);
            draw();
inGame();
        }
if (quit == true)
break;
        key = kb_ScanGroup(kb_group_1);  //2nd
    }
    gfx_End();
    prgm_CleanUp();
}
void draw(void){
userColor1 = false;
    setColor();
    gfx_FillRectangle(0, 0, 16, 60);
    setColor();
    gfx_FillRectangle(0, 60, 16, 60);
    setColor();
    gfx_FillRectangle(0, 120, 16, 60);
    setColor();
    gfx_FillRectangle(0, 180, 16, 60);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,4);
if (random == 1)
gfx_FillRectangle(0, 0, 16, 60);
if (random == 2)
gfx_FillRectangle(0, 60, 16, 60);
if (random == 3)
gfx_FillRectangle(0, 120, 16, 60);
if (random == 4)
gfx_FillRectangle(0, 180, 16, 60);
}
userColor1 = false;
    setColor();
    gfx_FillRectangle(308, 0, 16, 60);
    setColor();
    gfx_FillRectangle(308, 60, 16, 60);
    setColor();
    gfx_FillRectangle(308, 120, 16, 60);
    setColor();
    gfx_FillRectangle(308, 180, 16, 60);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,4);
if (random == 1)
gfx_FillRectangle(308, 0, 16, 60);
if (random == 2)
gfx_FillRectangle(308, 60, 16, 60);
if (random == 3)
gfx_FillRectangle(308, 120, 16, 60);
if (random == 4)
gfx_FillRectangle(308, 180, 16, 60);
}
}
void setColor(void) {
    colorChoice = randInt(1,5);
    if (colorChoice == 1) {
        gfx_SetColor(Gcolor1);
userColor = false;
}
    if (colorChoice == 2) {
        gfx_SetColor(Gcolor2);
userColor = false;
}
    if (colorChoice == 3) {
        gfx_SetColor(Gcolor3);
userColor = false;
}
    if (colorChoice == 4) {
        gfx_SetColor(Gcolor4);
}
    if (colorChoice == 5) {
        gfx_SetColor(Gcolor5);
userColor1 = true;
}
}
void setColors(int color1, int color2, int color3, int color4, int color5) {
    Gcolor1 = color1;
    Gcolor2 = color2;
    Gcolor3 = color3;
    Gcolor4 = color4;
    Gcolor5 = color5;
}
void inGame() {
int posX = 160, posY = 120;
while (kb_ScanGroup(kb_group_6) != kb_Clear) {
gfx_SetTextXY(150, 1);
gfx_PrintInt(score, 3);
getPixelLeft = gfx_GetPixel(posX-16, posY);
getPixelRight = gfx_GetPixel(posX+16, posY);
if (keyPress % 20 == 0) {
if (kb_AnyKey())
up = true;
if (up == false)
posY = posY + 4;
if (up == true) {
timer = true;
posY = posY - 3;
}
if (left == true)
posX = posX - 3;
if (left == false)
posX = posX + 3;
if (timer == true)
time++;
if (time == 10) {
time = 0;
timer = false;
up = false;
}
gfx_SetColor(181);
if (left == true && up == false)
gfx_FillCircle(posX+3, posY-4, 12);
if (left == true && up == true)
gfx_FillCircle(posX+3, posY+4, 12);
if (left == false && up == true)
gfx_FillCircle(posX-3, posY+4, 12);
if (left == false && up == false)
gfx_FillCircle(posX-3, posY-4, 12);
gfx_SetColor(Gcolor5);
gfx_FillCircle(posX, posY, 8);
if (left == true && getPixelLeft == Gcolor5) {
left = false;
score++;
colorChange++;
gfx_SetTextXY(150, 1);
gfx_SetColor(181);
gfx_FillRectangle(150, 1, 32, 10);
gfx_PrintInt(score, 3);
}
if (left == false && getPixelRight == Gcolor5) {
draw();
left = true;
score++;
colorChange++;
gfx_SetTextXY(150, 1);
gfx_SetColor(181);
gfx_FillRectangle(150, 1, 32, 10);
gfx_PrintInt(score, 3);
}
if (colorChange == 6) {
random = randInt(1,5);
if (random == 1)
Gcolor5 = Gcolor1;
if (random == 2)
Gcolor5 = Gcolor2;
if (random == 3)
Gcolor5 = Gcolor3;
if (random == 4)
Gcolor5 = Gcolor4;
if (random == 5)
Gcolor5 = Gcolor5;
colorChange = 0;
draw();
}
if (left == true && getPixelLeft != 181 && getPixelLeft != Gcolor5)
break;
if (left == false && getPixelRight != 181 && getPixelRight != Gcolor5)
break;
}
keyPress++;
}
if (score >= highscore) {
highscore = score;
    /* Close all open file handles before we try any funny business */
    ti_CloseAll();
     
    /* Open a file for writting*/
    file = ti_Open("clrhs", "w");
     
    /* write some things to the file */
    if (file)
         ti_Write(&highscore, sizeof(highscore), 1, file); 
}
quit = true;
}
/* Other functions */
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

I like the update. Will the ball move faster and faster as you progress?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

That is a good idea, if I do not make the ball move faster, I will make the color rectangles smaller, going from 4, to 6, to 8, and so on.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

The latter idea could work too, actually. Another idea could be to make it so the colors won't show up until you're halfway into the screen or so, but that would pretty much be the same as making the ball move faster.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

#10
Huh, that is also a good idea. I could add that as a challenge mode or something.

Anyways, and update!

So I've implemented a speed increase as you progress, as well as smaller rectangles of color. Once you hit 15 points or so, they will get smaller. In the screenshot I only have to reach 5, but that is for testing and demonstration purposes. Among other things, I have tweaked quitting and losing.


// Program Name:
// Author(s):
// Description:

/* Keep these headers */
#include <tice.h>

/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <debug.h>
/* Other available headers */
// including stdarg.h, setjmp.h, assert.h, ctype.h, float.h, iso646.h, limits.h, errno.h

/* Available libraries */
// including lib/ce/graphc.h, lib/ce/fileioc.h, and lib/ce/keypadc.h
#include <lib/ce/graphx.h>
#include <lib/ce/keypadc.h>
#include <lib/ce/fileioc.h>
/* Put your function prototypes here */
void setColors(int color1, int color2, int color3, int color4, int color5, int color6, int color7);
void draw(void);
void setColor(void);
void inGame(void);
/* Put all your globals here. */
int Gcolor1, Gcolor2, Gcolor3, Gcolor4, Gcolor5, Gcolor6, Gcolor7, colorChange, key, time, random, colorChoice, keyPress, getPixelLeft, getPixelRight, score;
ti_var_t file;
uint8_t highscore;
bool quit, up, left = true, timer, userColor, userColor1;
/* Put all your code here */

void main() {
ti_CloseAll();
file = ti_Open("clrhs", "r");
if (file) {
ti_Read(&highscore, sizeof(highscore), 1, file);
    }   
    else {
    highscore = 0;
    }
    srand( rtc_Time() );
gfx_Begin(gfx_8bpp);
    gfx_FillScreen(181);
    gfx_PrintStringXY("Don't Touch the Wrong Color!",60,1);
    gfx_PrintStringXY("Press any key to play",85,11);
gfx_PrintStringXY("Highscore:",105,51);
gfx_SetTextXY(180,51);
gfx_PrintInt(highscore, 3);
    while(kb_ScanGroup(kb_group_6) != kb_Clear) {
        if (kb_AnyKey()) {
            gfx_FillScreen(181);
            setColors(31,255,7,235,186,224,24);
            draw();
inGame();
if (quit == false) {
gfx_FillScreen(181);
gfx_PrintStringXY("Don't Touch the Wrong Color!",60,1);
gfx_PrintStringXY("Press any key to play",85,11);
gfx_PrintStringXY("Highscore:",105,51);
gfx_SetTextXY(180,51);
gfx_PrintInt(highscore, 3);
}
        }
if (quit == true)
break;
        key = kb_ScanGroup(kb_group_1);  //2nd
    }
    gfx_End();
    prgm_CleanUp();
}
void draw(void){
if (score >= 12) {
userColor1 = false;
setColor();
gfx_FillRectangle(0, 0, 16, 40);
setColor();
gfx_FillRectangle(0, 40, 16, 40);
setColor();
gfx_FillRectangle(0, 80, 16, 40);
setColor();
gfx_FillRectangle(0, 120, 16, 40);
setColor();
gfx_FillRectangle(0, 160, 16, 40);
setColor();
gfx_FillRectangle(0, 200, 16, 40);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,6);
if (random == 1)
gfx_FillRectangle(0, 0, 16, 40);
if (random == 2)
gfx_FillRectangle(0, 40, 16, 40);
if (random == 3)
gfx_FillRectangle(0, 80, 16, 40);
if (random == 4)
gfx_FillRectangle(0, 120, 16, 40);
if (random == 5)
gfx_FillRectangle(0, 160, 16, 40);
if (random == 6)
gfx_FillRectangle(0, 200, 16, 40);
}
userColor1 = false;
setColor();
gfx_FillRectangle(304, 0, 16, 40);
setColor();
gfx_FillRectangle(304, 40, 16, 40);
setColor();
gfx_FillRectangle(304, 80, 16, 40);
setColor();
gfx_FillRectangle(304, 120, 16, 40);
setColor();
gfx_FillRectangle(304, 160, 16, 40);
setColor();
gfx_FillRectangle(304, 200, 16, 40);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,6);
if (random == 1)
gfx_FillRectangle(304, 0, 16, 40);
if (random == 2)
gfx_FillRectangle(304, 40, 16, 40);
if (random == 3)
gfx_FillRectangle(304, 80, 16, 40);
if (random == 4)
gfx_FillRectangle(304, 120, 16, 40);
if (random == 5)
gfx_FillRectangle(304, 160, 16, 40);
if (random == 6)
gfx_FillRectangle(304, 200, 16, 40);
}
}
if (score < 12) {
userColor1 = false;
setColor();
gfx_FillRectangle(0, 0, 16, 60);
setColor();
gfx_FillRectangle(0, 60, 16, 60);
setColor();
gfx_FillRectangle(0, 120, 16, 60);
setColor();
gfx_FillRectangle(0, 180, 16, 60);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,4);
if (random == 1)
gfx_FillRectangle(0, 0, 16, 60);
if (random == 2)
gfx_FillRectangle(0, 60, 16, 60);
if (random == 3)
gfx_FillRectangle(0, 120, 16, 60);
if (random == 4)
gfx_FillRectangle(0, 180, 16, 60);
}
userColor1 = false;
setColor();
gfx_FillRectangle(304, 0, 16, 60);
setColor();
gfx_FillRectangle(304, 60, 16, 60);
setColor();
gfx_FillRectangle(304, 120, 16, 60);
setColor();
gfx_FillRectangle(304, 180, 16, 60);
if (userColor1 == false) {
gfx_SetColor(Gcolor5);
random = randInt(1,4);
if (random == 1)
gfx_FillRectangle(304, 0, 16, 60);
if (random == 2)
gfx_FillRectangle(304, 60, 16, 60);
if (random == 3)
gfx_FillRectangle(304, 120, 16, 60);
if (random == 4)
gfx_FillRectangle(304, 180, 16, 60);
}
}
}
void setColor(void) {
    colorChoice = randInt(1,7);
    if (colorChoice == 1) {
        gfx_SetColor(Gcolor1);
userColor = false;
}
    if (colorChoice == 2) {
        gfx_SetColor(Gcolor2);
userColor = false;
}
    if (colorChoice == 3) {
        gfx_SetColor(Gcolor3);
userColor = false;
}
    if (colorChoice == 4) {
        gfx_SetColor(Gcolor4);
}
    if (colorChoice == 5) {
        gfx_SetColor(Gcolor5);
userColor1 = true;
}
if (colorChoice == 6) {
        gfx_SetColor(Gcolor6);
userColor1 = false;
}
    if (colorChoice == 7) {
        gfx_SetColor(Gcolor7);
userColor1 = false;
}
}
void setColors(int color1, int color2, int color3, int color4, int color5, int color6, int color7) {
    Gcolor1 = color1;
    Gcolor2 = color2;
    Gcolor3 = color3;
    Gcolor4 = color4;
    Gcolor5 = color5;
Gcolor6 = color6;
Gcolor7 = color7;
}
void inGame() {
int posX = 160, posY = 120;
int speed = 20;
while (1) {
gfx_SetTextXY(150, 1);
gfx_PrintInt(score, 3);
getPixelLeft = gfx_GetPixel(posX-16, posY);
getPixelRight = gfx_GetPixel(posX+17, posY);
if (keyPress % speed == 0) {
if (kb_AnyKey())
up = true;
if (up == false)
posY = posY + 4;
if (up == true) {
timer = true;
posY = posY - 3;
}
if (left == true)
posX = posX - 3;
if (left == false)
posX = posX + 3;
if (timer == true)
time++;
if (time == 10) {
time = 0;
timer = false;
up = false;
}
gfx_SetColor(181);
if (left == true && up == false)
gfx_FillCircle(posX+3, posY-4, 11);
if (left == true && up == true)
gfx_FillCircle(posX+3, posY+4, 11);
if (left == false && up == true)
gfx_FillCircle(posX-3, posY+4, 11);
if (left == false && up == false)
gfx_FillCircle(posX-3, posY-4, 11);
gfx_SetColor(Gcolor5);
gfx_FillCircle(posX, posY, 6);
if (left == true && getPixelLeft == Gcolor5) {
left = false;
score++;
colorChange++;
if (speed >= 1)
speed--;
gfx_SetTextXY(150, 1);
gfx_SetColor(181);
gfx_FillRectangle(150, 1, 32, 10);
gfx_PrintInt(score, 3);
}
if (left == false && getPixelRight == Gcolor5) {
draw();
left = true;
score++;
colorChange++;
gfx_SetTextXY(150, 1);
gfx_SetColor(181);
gfx_FillRectangle(150, 1, 32, 10);
gfx_PrintInt(score, 3);
}
if (colorChange == 6) {
random = randInt(1,5);
if (random == 1)
Gcolor5 = Gcolor1;
if (random == 2)
Gcolor5 = Gcolor2;
if (random == 3)
Gcolor5 = Gcolor3;
if (random == 4)
Gcolor5 = Gcolor4;
if (random == 5)
Gcolor5 = Gcolor5;
colorChange = 0;
draw();
}
if (left == true && getPixelLeft != 181 && getPixelLeft != Gcolor5)
break;
if (left == false && getPixelRight != 181 && getPixelRight != Gcolor5)
break;
}
if (kb_ScanGroup(kb_group_6) == kb_Clear) {
quit = true;
break;
}
keyPress++;
}
if (score >= highscore) {
highscore = score;
    /* Close all open file handles before we try any funny business */
    ti_CloseAll();
     
    /* Open a file for writting*/
    file = ti_Open("clrhs", "w");
     
    /* write some things to the file */
    if (file)
         ti_Write(&highscore, sizeof(highscore), 1, file); 
}
}
/* Other functions */

What do you think? Look below for a download. :D
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Unicorn

Bump. Anyone who downloaded the above file got a faulty one. The new one I just uploaded will work.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

Ok I'll grab the file now and try later. :) By the way, I wonder if you would be able to add sprites and maybe make it like @semiprocoder game, but instead of having a shop, your flying :walrii: would change colors. You would need to have the wings be separate from the :walrii: sprite, though, and maybe change the color palette for him so you don't need to use like 8 different walrus sprites.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

Yeah, sprites are definitely planned, maybe a :Walrii: Easter egg as well..
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dudeman313

  • Calculators owned: TI-84 PCE
  • Consoles, mobile devices and vintage computers owned: Android O Phone
Does this qualify as a signature? 
The answer is "Sure."


Powered by EzPortal