* 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: Cookie Clicker for the Nspire!  (Read 2577 times)

0 Members and 1 Guest are viewing this topic.

Offline semiprocoder

  • Full User
  • Join Date: May 2015
  • Location:
  • Posts: 282
  • Post Rating Ratio: +2/-0
    • awesommee333
    • 114/11470
  • Gender: Male
Cookie Clicker for the Nspire!
« on: November 29, 2015, 09:23:42 pm »
COOOOKIIEEEESSSS!!!!!!!!!!!


 Yesterday I started working on cookie clicker for the nspire, and here is the first version of cookie clicker for the nspire. Right now it has 9 producers of cookies, including a walrus. It also supports upgrades for each tower and clicking(although I need to balance it a bit still).

Currently the help and settings menu don't do anything, and only game does anything. I may end up removing the settings menu, as I do not see any real use for it.

Controls: use arrow keys to scroll through menu and press enter to go into one of the parts. In the game click on the cookie or the producers to get buy or get extra cookies. Use left and right keys to scroll between the different producers of cookies.
Press 'u' to upgrade producers/mouse. Again click on what you want to upgrade and use arrow keys to scroll.

The images are taken from the actually cookie clicker images, and the background is just a random cool background I found online that I included in my files just to show that my code supports backgrounds. I hope to replace it with something else soon.

Edit:
First off, what do you think about me adding a potato(http://www.lulu.com/shop/rinardo/the-holy-scripture-of-rinardo/ebook/product-22008800.html). I am planning it to be right under walrus or even above it. Also I need to make everything more expensive, as it takes me about 30 mins to get even the walrus.

Here is the list of glitches I know about:

1. Font size:
Despite me setting the font size to 7, which is one of the values the ti nspire supposedly support, the font size stays default. This is really annoying because stuff has to be scrunched too far together and it often goes off screen.

2. Vars not saving properly:
This is probably my bad coding, but anyways, sometimes when you upgrade clicking it resets you clicking power to 0 and the cost to 3. I think I fixed this but I am not sure. Once I come up with larger changes I will update the downloads.
This is probably the most annoying glitch. This only has to do with the var "statsCookieSPC"(money, money per click, and upgrade cost for the money per click. It also only happens if you buy something ie. save something in the var "statsProducerSPC", which stores everything else

3. When you open the game again without closing it fully(like when you open another file), the game doesn't work at all. You have to open something else to make the game work again. Also think I have fixed this.
« Last Edit: December 01, 2015, 02:20:23 am by semiprocoder »


  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #1 on: November 29, 2015, 11:31:20 pm »
This looks good. I saw an earlier screenshot on IRC and was gonna suggest adding that blue background from the PRIZM version to spice things up. I'm glad that it was already added. Also nice to see :walrii: in the game (you should probably call it Walrii, though :P)
« Last Edit: November 29, 2015, 11:34:02 pm by DJ Omnimaga »
  • Calculators owned: TI-57, 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 semiprocoder

  • Full User
  • Join Date: May 2015
  • Location:
  • Posts: 282
  • Post Rating Ratio: +2/-0
    • awesommee333
    • 114/11470
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #2 on: November 30, 2015, 01:10:06 am »
Can anyone who knows lua help me with a small(ish) issue?

I have an issue with saving the producer's stats right now. Here is my code(I have print statements there because I was checking what didnt work):
Code: [Select]
function game.cookieProducer:storeVars()
var.storeAt("statsProducersSPC", self.cost, self.id*4-3)--also needs to be improved
if var.recallAt("statsProducersSPC", self.id*4-3)==nil then
print("cost not working")
end
var.storeAt("statsProducersSPC", self.output, self.id*4-2)
if var.recallAt("statsProducersSPC", self.id*4-2)==nil then
print("output not working")
if self.output==nil then
print("wut")
end
end
var.storeAt("statsProducersSPC", self.amt, self.id*4-1)
if var.recallAt("statsProducersSPC", self.id*4-1)==nil then
print("amt not working")
end
var.storeAt("statsProducersSPC", self.upgradeCost, self.id*4)
end

The issue is that all the print statements are printing(showing that the vars aren't being saved), and my recall vars statement never set my variables because they are all nil.
« Last Edit: November 30, 2015, 01:20:38 am by semiprocoder »
  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3158
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #3 on: November 30, 2015, 02:12:12 pm »
Looks pretty good :) what doe the :3= do?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #4 on: November 30, 2015, 08:24:36 pm »
I think it's just there as the last item/thing, except instead of the usual Cookie Clicker final item, it's a walrus.
  • Calculators owned: TI-57, 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 LD Studios

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 136
  • Post Rating Ratio: +10/-0
    • LD Studios
Re: Cookie Clicker for the Nspire!
« Reply #5 on: November 30, 2015, 09:01:07 pm »
the first version of cookie clicker for the nspire
lies :P
Yours looks better though :P

Might I suggest adding some more spaces though before text? Like, add a bit of  margin between the left side of the screen and the Money, Output labels, and the same thing for your stats next to the different things you can buy.



Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #6 on: November 30, 2015, 09:05:53 pm »
I seem to recall at least another with a white background, but I forgot who made it. I know that JWinslow23 made two versions, but neither were for the Nspire. Spenceboy98 made a PRIZM version and Kerm a CSE version.
  • Calculators owned: TI-57, 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 LD Studios

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 136
  • Post Rating Ratio: +10/-0
    • LD Studios
Re: Cookie Clicker for the Nspire!
« Reply #7 on: November 30, 2015, 09:08:36 pm »
I seem to recall at least another with a white background, but I forgot who made it. I know that JWinslow23 made two versions, but neither were for the Nspire. Spenceboy98 made a PRIZM version and Kerm a CSE version.
That was probably me with the white background, but then I updated it- Not a very good update though because I added falling cookies in the background which create a lot of lag when you get to higher scores :P



Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #8 on: November 30, 2015, 09:12:49 pm »
Oh right, I didn't realize that the cookies were animated. Is the lag still present on OS 3.6 or was it only on 3.1 and lower?

Also, I wonder if some PICO-8 games would be feasible in Nspire Lua (eg that racing game I posted in the PICO-8 thread)
  • Calculators owned: TI-57, 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 LD Studios

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 136
  • Post Rating Ratio: +10/-0
    • LD Studios
Re: Cookie Clicker for the Nspire!
« Reply #9 on: November 30, 2015, 09:18:25 pm »
Oh right, I didn't realize that the cookies were animated. Is the lag still present on OS 3.6 or was it only on 3.1 and lower?

Also, I wonder if some PICO-8 games would be feasible in Nspire Lua (eg that racing game I posted in the PICO-8 thread)
No, the lag would be present on any OS considering how it outputs one cookie for every cookie created (so when you're outputting thousands per second...)- I could have sworn I blocked it from displaying more than about 30 at a time, but I just tested it and apparently not. *oh well*

There are a fair amount of commands in PICO-8 that don't exist in Nspire Lua such as the setPixel and getPixel (or whatever they're called), as well as tall the built in tilemapping stuff.

EDIT: ***This thread should probably get back on topic though*** :P



Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #10 on: November 30, 2015, 09:56:35 pm »
Yeah the PICO-8 remark is because you seems a bit hard to reach on WalrusIRC sometimes :P. Maybe I should start a new topic about if some PICO 8 games could be feasible in Nspire Lua, though. And yeah I believe that blocking cookies at 30 would be better, or you could only animate 30 a second and loop through a longer list but then the cookies would fall slower  still.
  • Calculators owned: TI-57, 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 semiprocoder

  • Full User
  • Join Date: May 2015
  • Location:
  • Posts: 282
  • Post Rating Ratio: +2/-0
    • awesommee333
    • 114/11470
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #11 on: November 30, 2015, 11:20:35 pm »
the first version of cookie clicker for the nspire
lies :P
Yours looks better though :P

Might I suggest adding some more spaces though before text? Like, add a bit of  margin between the left side of the screen and the Money, Output labels, and the same thing for your stats next to the different things you can buy.

Well ldstudios I must apologize then. I only checked on ticalc as I don't participate on omninaga(only really joined calc community in september), and I don't check ti planet cause most of that is french. I'll change that I guess.

Anyways, ldstudios do you know vars well? Because right now I am having great difficulty in saving my money. It may somehow be a glitch of my code, idk, but I don't think so. I printed the values of self.money every timer tick, and they were all good. However, when I closed the game back again and restored the money it is a random value. I am not exactly sure why this happens, but I know it only happens if I buy something first, which saves those values in a different var. I have been trying to figure it out for like an hour, but I have no idea where the issue actually lies.

I will update my lua code for the more updated version and don't pay attention to my old question I fixed that but then this issue arose.

I fixed it after another hour of putting print statements everywhere. I finally figured out that I wasn't setting prevTime to anything when I open my game. Thus the difference between prevTime and millis() the first run of timer was huge and it added a huge amount of money to the game.
« Last Edit: December 01, 2015, 12:15:36 am by semiprocoder »
  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

Offline LD Studios

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 136
  • Post Rating Ratio: +10/-0
    • LD Studios
Re: Cookie Clicker for the Nspire!
« Reply #12 on: December 01, 2015, 01:26:38 am »
Just a few spots of advice
1) You should make your documents 3.1 compatible ;)
2) I usually use on.save and on.restore rather than saving math variables. I find it to be a little neater in the code, and it also prevents people from cheating by altering the variables from a calculator page, not to mention math variables will take up more space in your document! See here for more info on that.

EDIT:
3. When you open the game again without closing it fully(like when you open another file), the game doesn't work at all. You have to open something else to make the game work again.
There is some sort of bug where the timer glitches out upon minimizing lua documents. I recommend pausing the timer on on.deactivate() and resuming it with on.activate()
« Last Edit: December 01, 2015, 01:37:14 am by LD Studios »



Offline semiprocoder

  • Full User
  • Join Date: May 2015
  • Location:
  • Posts: 282
  • Post Rating Ratio: +2/-0
    • awesommee333
    • 114/11470
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #13 on: December 01, 2015, 01:29:35 am »
Just a few spots of advice
1) You should make your documents 3.1 compatible ;)
2) I usually use on.save and on.restore rather than saving math variables. I find it to be a little neater in the code, and it also prevents people from cheating by altering the variables from a calculator page, not to mention math variables will take up more space in your document! See here for more info on that.

1) no idea how to use string images still(and I think I had one other function that isn't compatible, but I am not sure)
2) I made my code badly and it would take a while to change it to work with on.save and on.restore, so I may do that, but not right now.
  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18429
  • Post Rating Ratio: +93/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Cookie Clicker for the Nspire!
« Reply #14 on: December 01, 2015, 01:31:49 am »
I agree about 3.1. Some Ndless users still use 3.1 for larger memory and also the annoyances of 3.6 (perhaps they don't want to deal with nLaunchy). But I am ok if the game works on at least OS 3.6. Just don't make it 3.9-only.
  • Calculators owned: TI-57, 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)

 


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