* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Don't Touch the Spikes CE Port  (Read 1332 times)

0 Members and 1 Guest are viewing this topic.

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Don't Touch the Spikes CE Port
« on: June 19, 2016, 01:16:56 pm »
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
« Last Edit: July 01, 2016, 02:35:23 am by Unicorn »


  • 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 ??? ??? ??? ??? ???



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

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #1 on: June 19, 2016, 04:14:26 pm »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 313
  • Post Rating Ratio: +13/-0
    • View Profile
Re: Don't Touch the Spikes CE Port
« Reply #2 on: June 21, 2016, 09:28:41 am »
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  :)

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #3 on: June 22, 2016, 03:50:20 pm »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #4 on: July 02, 2016, 05:53:08 pm »
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.



Code: [Select]
// 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 ??? ??? ??? ??? ???



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

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #5 on: July 03, 2016, 04:30:36 pm »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #6 on: July 03, 2016, 11:54:30 pm »
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.

Code: [Select]
// 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 */
« Last Edit: July 04, 2016, 02:02:01 am by Unicorn »
  • 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 ??? ??? ??? ??? ???



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

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #7 on: July 04, 2016, 12:21:45 am »
I like the update. Will the ball move faster and faster as you progress?
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #8 on: July 04, 2016, 12:37:14 am »
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 ??? ??? ??? ??? ???



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

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #9 on: July 04, 2016, 05:45:24 am »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #10 on: July 04, 2016, 05:10:00 pm »
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.


Code: [Select]
// 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
« Last Edit: July 05, 2016, 12:00:37 am by Unicorn »
  • 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 ??? ??? ??? ??? ???



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

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #11 on: July 05, 2016, 12:00:17 am »
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 ??? ??? ??? ??? ???



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

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17480
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #12 on: July 05, 2016, 12:03:12 am »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2716
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #13 on: July 05, 2016, 12:05:54 am »
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 ??? ??? ??? ??? ???



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

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1515
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • View Profile
    • My Sprites and Walrii Collection
  • Gender: Male
Re: Don't Touch the Spikes CE Port
« Reply #14 on: July 05, 2016, 05:14:05 am »
Sure looks like fun!
  • Calculators owned: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games