Repeat D>1
Menu(" FLAPPY BIRD ","STANDARD SPEED",A,"SET SPEED",B,"RANDOM SPEED",C
Lbl A
15→D
Goto D
Lbl B
Input "SPEED",D
Goto D
Lbl C
randInt(1,25)→D
Lbl D
End
ClrHome
4→Y
⁻1→S
Repeat Y>10
randInt(3,7)→H
S+1→S
For(V,26,1,⁻1)
If Y>10:Goto E
If V=2 and (Y≠H and Y≠H-1):Goto E
If Y≤10:Output(Y,2,">"
For(E,1,H-2)
Output(E,V,"I"
End
For(E,H+1,10)
Output(E,V,"I")
End
For(E,1,D)
End
For(E,1,10)
Output(E,V," " //one space (Do not type in "//one space", we're trying to say "use the space key on the calculator")
End
Output(1,24,S
getKey→K
If not(K)
Then
If Y≤10:Output(Y,2," " //one space
Y+1→Y
End
If K and Y>1
Then
If Y≤10:Output(Y,2," " //one space
Y-1→Y
End
End
End
Lbl E
ClrHome
Disp "GAME OVER!"
Pause S
Regarding changing the speed, couldn't you put some lines that ask for user input? Like this:
:Repeat D>1
:Input "SPEED:",D
:End
What if I added this change?
Repeat D>1
Menu(" FLAPPY BIRD ","SET SPEED",A,"RANDOM SPEED",B
Lbl A
Input "SPEED",D
End
Goto C
Lbl B
randint(1,25)→D
ClrHome...
This would give the user an option of either setting the speed manually or playing with a randomly set speed.
Yes, that would work. I was trying to stick with the roots of the program, and also semi-optimization, which is why I didn't include an input for it in my version. I could have removed several parentheses and closing quotations to optimize it but left them in for readability
Who downloaded the program in the 12 minutes since it's upload to give it a 5-star rating?
Where is this optimized for the CE/CSE version? I see nothing different from My Flappy Bird 2 page other than the speed input at the beginning.
Looking at the My Flappy Bird 2 code, it would definitely work on a CSE/CE, but it would be off center because it uses the homescreen. The C series homescreen is 10x26, so values for Output( and related commands are adjusted for the newer version.
The solution to a complex problem is often a simple answer.
Thanks for watching my back while I was (briefly) gone. I don't want to start a copyright infringement battle.
Indeed, now that I am looking at it closer, it seems like the only addition to this is a speed increase…
EDIT: Sorry, I didn't see that there :)
*makes mental note to test code first before judging it.
When the game ends, I want to display the final score with these two lines:
Disp "GAME OVER!"
Disp "YOUR SCORE ",S
I have tried putting these lines at the end of the code, but the program will not display the score for whatever reason. What do I need to do differently to fix this?
Uhhhh…it should work just as it is…
:Disp "GAME OVER!"
:Pause S
Are you putting the score at the right place? (I'm pretty sure you are). Try it again with your code.
That will not work because of the conditionals which test for a game-ending condition. They are both set to execute "Stop" which immediately ends the program. To do something different, you would have to change it to "Goto E" and then at the bottom add "Lbl E" followed by the code you want to run before exiting the program
I did that, and that fixed the program. I'll edit the page and the download soon.
EDIT: And it is done. I think we have fully optimized the Flappy Bird.
Found a small memory leak in your code. It's only ever executed once, so its not that important, but still it should be fixed.
Repeat D>1
Menu(" FLAPPY BIRD ","STANDARD SPEED",A,"SET SPEED",B,"RANDOM SPEED",C //menu options work just like a goto
Lbl A //this is fine, since its inside the Repeat
15→D
Goto D //this exits the Repeat before the end command
Lbl B //this is fine since its inside the Repeat
Input "SPEED",D
End //This is the end of the repeat
Goto D //this is fine since it's outside the repeat
Lbl C //the menu exits the repeat here, before the end command
randInt(1,25)→D
Goto D //this line is redundant, since it would execute Lbl D next anyways
Lbl D
ClrHome
//rest of code
I would do:
Repeat D>1
Menu(" FLAPPY BIRD ","STANDARD SPEED",A,"SET SPEED",B,"RANDOM SPEED",C
Lbl A //this is still inside
15→D
Goto D //now this doesn't exit the loop, it just skips to the end
Lbl B //this is still inside
Input "SPEED",D
Goto D //now this doesn't exit the loop, it just skips to the end
Lbl C //this is now inside, so the menu won't exit the loop
randInt(1,25)→D //notice there is no Goto for Lbl C, since the program would execute Lbl D next anyways.
Lbl D
End
ClrHome
Well, thanks for pointing that out! I'll have it fixed shortly.
EDIT: I changed the written code and the download. What would we do without you here to point out our mistakes?
#Trenly for Mod/Admin :D
It seems that you can do is this: I've heard lots of programmers on wikidot "discovered" and used lower-case coding. If you do have it, great! Press [Alpha][Alpha] to activate it. But let me tell you, this is optional, and may crash your calculator if you do not code it in right, or have a low amount of ram. (This happened to me before, and I learn from my mistakes.) Make sure you have AT LEAST 15,430 kilobytes of RAM left. You should be ok depending on what TI- Graphing calculator model you use. I use an 84 Plus.
Lowercase letters actually take up more bytes in your program, so it's best not to use them all the time. It can look nice though :)
I have used lowercase with less ram than that and been fine
Got it from page 11 of the 1337 Guide to TI-BASIC, but know that I think about it, I have never tested it myself…
*makes note to try this later
Your program is great, but still fix the memory leak. My calculator would not stop the loop till I completely drained it of power, that was sort of a really weird crash, but I managed to correct it when I re-code it it. Thanks in advance!
I fixed the memory leak 12 days ago. Also, I used it several times before I fixed the memory leak, and it never crashed. Granted, I have a lot of RAM available, so it probably wouldn't affect my calculator.
you guys know how to create a program that asks for username/password when you turn it on?
You could make a program that asks for the password, then download and set up Start-Up Customization to have it run when you turn your calculator on. A suggested program that I made:
Main program
:While 1
:Input "PASS:",Str1
:If Str1=Str0:Then //Str0 is the password you choose to create. Define it before you install Start-Up Customization.
:Stop
:Else
:Asm(prgmOFF //Will make the calculator look like it's off, more info at http://tibasicdev.wikidot.com/hexcodes#toc35
:End
PRGM:OFF
AsmPrgm3E02D310C9 //The Hexcode that turns off the LCD
A username seems unnecessary, so I didn't include that.