|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
You have not uploaded your program! Please edit the page to upload your program.
|
![]() |
||||||||||||||
|
Pong for CE calculators. Includes a Versus CPU game mode AND a high score mode. (High scores are not recorded) Use the arrow keys to move the paddle, 2nd to pause the game, and enter to resume the game. Version 2.0 includes an option for the user to choose the color of the paddle, as well as overall improvements to the game. |
|||||||||||||||

What the community thinks:
Here is a working Pong for CE calculators (Note that this will NOT work on CSE calculators).
Might I ask how fast the game is able to run? I tried throwing a simple version together on my CE in my study hall today and it was functional but really slow.
Here's the code, with just the game loop and a basic AI for the second player.
Also, are the Wait commands the only thing stopping a port to CSE? Cause there are other ways to cause delays that work on older OS's.
The solution to a complex problem is often a simple answer.
I had issues with speed at first, when the program had a whole bunch of glitches. I got the program to run faster after I fixed the glitches. I stored important values to variables and had conditionals check the value of the variables to determine which direction the ball should move, and which direction the AI should move. (Competent AI is hard to make, by the way). I had to keep the conditionals simple to make the program fast, but that was something I could work with.
As far as I can see, the Wait commands are the only thing preventing the program from running on a CSE. I did that intentionally, because I felt that using the Wait command would be more efficient than a different method. Someone could easily change those lines of code and have a working Pong game on a CSE. I'm pretty sure there are other CE exclusive commands, but I believe Wait is the only one I used.
EDIT: How did you choose to make the ball to move? I'm curious about the methodology of your movement math, since I didn't do what I originally planned on doing with the ball's movement.
My movement math is fairly simple: The ball has an X and Y velocity, stored as P and Q. The ball's coords change by P and Q each frame. When the ball hits a surface (either the floor/ceiling or paddles), the velocity for that direction is negated. The other velocity component is unaffected.
So, if the ball hits the floor, its downward Y velocity is negated (-Q→Q) to become upward velocity. If it hits your paddle, its rightward X velocity is negated (-P→P) to become leftward velocity.
The solution to a complex problem is often a simple answer.
Ok. That's what I did, where either 5 or -5 was stored to the velocity variables. I was originally going to use trig, but I quickly decided that wouldn't be a practical method.
Hi there.
I'm fairly new to this website, so I'm not sure if I am allowed to post on old threads. I thought it is okay for this since it is on archives, though.
I was looking through this code, and it looks like you used Lbls and Gotos to change the color of the paddle with a menu command. To make this much simpler and more efficient, something I have done in the past is to save colors to a string and call a character from the string. Here is an example of it's use in making fireworks:
For your use, you could have rows of text and a ">" that moves with a up and down, stores to a variable, and takes that color from the string.
Once again, I am fairly new, so I'm not sure if this would work on all calculators. I would be glad if this could help you.
Also Myles, thank you for contributing so much to the wikidot community; I love your programs.
Thanks!