Name: Dodge (as of today it is in beta)
Goals: It is a game, so goals are to run smoothly and be fun.
What has happened: A simple game so far... so not that much.

So the game is basically you control the pi and you want to avoid the falling !'s. I want to find a way to make multiple falling !'s but I don't know how to do that.

Would it help if I had the source code included?
For the multiple "!"s, I think using multiple variables would work, but it could get very hard to manage.

P.S. nice userbar
princetonlion.tibd wrote:
For the multiple "!"s, I think using multiple variables would work, but it could get very hard to manage.

P.S. nice userbar

Yes, it's very hard to manage, so I was wondering if there was a simple way or something.
you could have one counter count up every cycle, and store for each object the initial value and then always draw the offset.
Sorunome wrote:
you could have one counter count up every cycle, and store for each object the initial value and then always draw the offset.

Um, I do not understand...

I am a newbie to Cemetech and Ti-Basic
Well this is funny. I made pretty much this exact game when I was first learning to program. In TI-BASIC too! the trick is to use a list. Here's a simplified version of your game:


Code:
1 -> r
while r
getkey -> k

if k = 24
then
x - 1 -> x
end

if k = 26
then
x + 1 -> x
end

output(8,x,"8")


For(i,1,length(L1))
L1(i) + 1 -> L1(i)
if L1(i) = 9
then
del L1(i)
del L2(i)
dim(L1)+1 -> L
L -> dim(L1)
L -> dim(L2)
1 -> L1(dim(L1))
randInt(1,16) -> L2(dim(L2))
else
output(L1(i),L2(i), "0")
end
if L1(i) = 8 and L2(i) = x
then
0 -> r
end
end
end


This is of course simplified. There are no menus, high scores, or really any other game mechanics other than dodging the falling "0"s. But still, its a start.

Ps. I changed the player to and "8" and the falling obsticles to "0"s
Sorunome wrote:
you could have one counter count up every cycle, and store for each object the initial value and then always draw the offset.

Do you mean something that "+1" to a variable every time the loop runs?


Also, Spud, we still don't know how to use lists to our advantages
Ah I see...
hmmmm...
uh huh...
well the code is right there so study it.
I'll just reread some more tutorials.
Well, looks like some code is in store!

Here it is:

Code:
CLASSIC
While Ans!=45
Delvar L1DelvarQClrHome
For(R,1,6
randInt(1,16>L1(R
End
getKey
While Ans!=45 and Q!=8
Q+1>Q
For(P,1,6
If Ans:Then
Output(8,X,"
X+(Ans=26)-(Ans=24>X
Output(8,X,"+
End
Output(Q,L1(P),"!
If Q=8 and X=L1(P
Return
getKey
End
Output(Q,1,"                -16
End
End


EDIT: This is a quicker version, which draws the falling "!" and gets movement at the same time. If you have any questions, just ask!

EDIT: Spud, by the way, length() is only used on strings. Smile

EDIT: Spud, what is del? Looks like your list will keep increasing forever! Smile
We were trying to make the same thing.

I like the list idea. We're trying to add some more features, find more bugs, and port it to the graph screen.

None of us really understand the ans variable.
princetonlion.tibd wrote:
We were trying to make the same thing.

I like the list idea. We're trying to add some more features, find more bugs, and port it to the graph screen.

None of us really understand the ans variable.


The Ans varible is right on top the - sign, and takes on the value of whatever was executed previously. For instance, if 'getKey' was called, Ans would hold the key value.

EDIT: Porting to the graph screen is a little more difficult, but as long as you change your step over each loop, it should not be too much slower.
That is precisely all we know.
princetonlion.tibd wrote:
That is precisely all we know.


Cool, then let's learn some more! Ans is also useful to tell if input is a string or a number, can be used with pretty much ever varible type, and since there is a direct command in TI-OS called RCLANS, it just makes the most sense to use! Also, it can be useful because it does not stick around in your RAM (Well it does, but it doesn't take up the memory screen like the letter varibles)
I guess I'll reread Kerm's book a few times and the ticalc tutorial I'm so attached to.
princetonlion.tibd wrote:
I guess I'll reread Kerm's book a few times and the ticalc tutorial I'm so attached to.


Sounds good! If you have any questions, there is always this place! Wink

Oh wow, by the way, if you add a CLASSIC token at the top of my above program, if will run about 10 times faster! Try it out!
princetonlion.tibd wrote:
I guess I'll reread Kerm's book a few times and the ticalc tutorial I'm so attached to.


YES
"Programming the TI 83+/84+" was so helpful!

I'll probably give it another read soon.
Cemetech is always the best place!
Well, CLASSIC works if you have a 84+/SE. The 83s don't have that option.
gaventemples31415 wrote:
Well, CLASSIC works if you have a 84+/SE. The 83s don't have that option.


What happens if you have the CLASSIC on a ti83+?
Does it crash or does it just ignore it?

spud2451 wrote:
Ah I see...
hmmmm...
uh huh...
well the code is right there so study it.


Well that's not my source code but I guess it works...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement