|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
[appleeaters]1 goes left instead of left and down!
Hello!
If I do $cR->move(1); the robotslib prints out The player moved from (97,100 ) to (96,100 ) (command: 1) Instead of "to (96,99)"! First I assumed a coding mistake in robotslib.php. The corresponding code passage looks like this: case 1: $this->player[0]--; $this->player[1]--; break; If I print_r the $this->player array before break; it says Array ( [0] => 96 [1] => 100 ) How can that be? Thank you very much, Yarin |
|
#2
|
|||
|
|||
|
[appleeaters]RE: 1 goes left instead of left and down!
I've seen this error before too (causes the robots AND the player to only be able to move left/right), but couldn't find a fix for it, so I restored to the original copy of robotslib and generated a new game and the bug went away. The only thing I could come up with in my mind was that PHP crapped out for some unknown reason and couldn't write to the Y co-ordinate.
One other thing to check: when using $robots->move($move), make sure to capture the return into $game or some other variable. It may be that you're not recapturing the $game variable and that somehow, PHP is copying the old value back in to the new or something like that. But past that I have absolutely no idea. I just remember that's some of the things that ran through my mind when I ran into the problem a few days ago. Hope that helps.. |
|
#3
|
|||
|
|||
|
[appleeaters]RE: 1 goes left instead of left and down!
Thanks for your reply.
Meanwhile I found 2 bugfixes: 1. Turn $this->player[1]--; into $this->player[1] = $this->player[1] - 1; will work. 2. Fidians (great) extended robotslib.php does not have this bug [and works even better] --> http://rumkin.com/php_contest/ Thanks Fidian! |
|
#4
|
|||
|
|||
|
[appleeaters]RE: 1 goes left instead of left and down!
The URL is now http://rumkin.com/reference/php_contest/
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [appleeaters]1 goes left instead of left and down! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|