Code:


0üC
Lbl 00
0üG
8üA
8üB
ClrHome
Lbl 10
0üG
Output(1,1,"   ==========      I        I
Output(A,8,"o
Output(4,B-1," "
Output(4,B,"0
(B+1)üB
Output(1,1,C
If B>11:Then
Goto 11:End
rand(5
getKeyüG
If Gø0:Goto 20
Goto 10
Lbl 11
Output(4,B+1," "
Output(4,B,"0
(B-1)üB
If B<6:Then
Goto 10:End
rand(5
getKeyüG
If Gø0:Goto 20
Goto 11

Lbl 20
If G=21:Then
Goto 21:End
If G=22:Then
Goto XX:End

Lbl 21
Output(A,8,"o"
rand(10
(A-1)üA
Output(A+1,8," "
If A=2:Then
ClrHome
Output(4,6,"Nice
Output(5,6,"Shot!":Pause
(C+1)üC
Goto 00:End
Goto 21

Lbl XX
ClrHome
Output(1,1,""


I would just like to know how to make it so when the goalie (the 0) hits the ball (the o) that how to catch that so it doesn't go right thru the goalie.

By the way if anyone wants to make fun of the crappy coding go ahead I made it in 20 minutes in algebra today.

Edit: And if you cannot figure out what the u's with the dots ontop it means ->.
It would be really nice if you could get rid of the labels Wink

I haven't read through all of it, but it will probably be when the coordinates of the ball = the coordinates of the goalie, or are 1 below the goalie.
thats exactly my problem i do not know when to do the coordinates of the ball = the coordinates of the goalie. HELP!
First try converting it into a while loop or repeat loop, then it will become much easier to understand

Here is a bare skeleton:

Code:

[setup code if any]

repeat G

repeat ans
getkey
end
ans->k

[k conditionals]



if --- [for when you kick the ball]
then
---
---

[do the entire hitting ball part in here, and also if it hits the goalie]
if [ballx] = [goaliex] and [bally] = [goaliey]
1->g


end

end


congrats, good shot, etc.


I probablyu got the whole Idea wrong, I haven't read the entire piece of code yet, but if you can convert it it WILL be easier to understand
I am currently writing a streamlined version. gimme 12 more minutes.

EDIT:

Lbl 1
1üB
8üA
DelVar Z
DelVar K
ClrHome
Output(1,1," ========== I I
Output(8,8,"*
While .5((Aø4)+(BøCool)
Output(A,8,"*
If Z
Then
Output(4,B,"
B-1üB
Output(4,B,"0
Else
Output(4,B,"
B+1üB
Output(4,B,"0
End
If B=3
DelVar Z
If B=14
1üZ
If A<8
A-1üA
getKey
If Ans and A=8
Then
Output(A,8,"
7üA
End
If A=2
Goto 2
If A<8
Output(A+1,8,"
End
ClrHome
Disp "YOU ARE A FAIL
Pause
Goto 1
Lbl 2
ClrHome
Disp "YAYS GO YOU
Pause
Goto 1


Yes yes i know, its bad, but I tried to do it in under 12 minutes =D
  
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 1
» 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