Author |
Message |
Velocity
|
Posted: Mon Dec 19, 2011 8:42 pm Post subject: My logic doesnt seem to make my A.I move! |
|
|
What is it you are trying to achieve?
Making my A.I (the computer) move left and right
What is the problem you are having?
I cant seem to make him move
Describe what you have tried to solve this problem
I used my logic to find the answer. I don't know if i am anticipating this correclty or if i just ain't doing it the right way.
Turing: |
if x1_ 1 >= maxx div 2 and x2_ 2 >= maxx div 2 + 105 then
x1_ 1 + = 10
x2_ 2 + = 10
end if
if x1_ 1 <= maxx - 150 and x2_ 2 <= maxx - 30 then
x1_ 1 - = 10
x2_ 2 - = 10
end if
% This is the main movement focus, why doesnt it move?
|
Please specify what version of Turing you are using
4.1.1a |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Mon Dec 19, 2011 9:09 pm Post subject: RE:My logic doesnt seem to make my A.I move! |
|
|
If both if statements are true, will it move?
Can you think of a scenario where both cases return true? |
|
|
|
|
|
Velocity
|
Posted: Mon Dec 19, 2011 9:14 pm Post subject: RE:My logic doesnt seem to make my A.I move! |
|
|
when the paddle is in the middle of the screen both cases return true
so are you telling me to reword them or to add = true at the end of each?
I think your telling me to reword them? |
|
|
|
|
|
Tony
|
Posted: Mon Dec 19, 2011 9:17 pm Post subject: RE:My logic doesnt seem to make my A.I move! |
|
|
I think that you should think about what _should_ happen in situations when both of those statements are true. Should the AI move? If so, in which direction? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Velocity
|
Posted: Mon Dec 19, 2011 9:36 pm Post subject: RE:My logic doesnt seem to make my A.I move! |
|
|
hm never thought about the elsif's thanks for bringing that up. hah, strange... that actually never entered my mind. |
|
|
|
|
|
|