![]() |
Problem with move
For some reason, when the NPC reaches directly behind the player, the position of the NPC resets to the start position. This shouldn't happen. Can anybody help me?
PHP Code:
|
It might be due to the block check - if move() is checking for blocking tiles (4), and it encounters one, it resets back to the position where it was at before using move().
|
Thank you so much.
|
Ok this thread title summarizes my problem, so I will post here too (sorry for the thread steal codein <3)
PHP Code:
this.angle = getangle(vecx(player.dir), vecy(player.dir)); this.speed = .5; the move angle goes into an extremely different angle when fired Suggestions? |
Quote:
PHP Code:
|
hmm, still not working
here is the control weapon: PHP Code:
The image shoots way off to an extreme corner of the level, then disappears |
not sure, but try using different variables instead of angle & speed, like this.pangle and this.pspeed. Otherwise I'd sugest looking at your way to measure angles, etc.
|
For angle, try
PHP Code:
http://img213.imageshack.us/img213/3049/planexy2.png So, to get the right result with getAngle(), you'd have to do something like this: PHP Code:
|
| All times are GMT +2. The time now is 02:38 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.