Pixel Movement

by Forum_account
Pixel Movement
A pixel movement library for isometric and top-down maps.
ID:792479
 
I am making my game using this library and now i coded fly verb, when ever i set user density to 0 and they bump into densed obj it will just return.
The problem you're having should be that the player is bumping into turfs while the player is non-dense. The default behavior of can_bump() only checks whether the turf is dense (in 2D mode), and I'm not sure if Forum_account forgot to check src.density there like he does with non-turfs.

Solution:
mob
can_bump()
// if: you're not flying
// Call the default behavior
// Return the result
// else: Return 0 to prevent bumping
return !flying && ..()

That way, you don't even need to use density. You can just check if the player is flying by toggling the 'flying' variable used by the fly() verb.
In response to Kaiochao
Kaiochao wrote:
The problem you're having should be that the player is bumping into turfs while the player is non-dense. The default behavior of can_bump() only checks whether the turf is dense (in 2D mode), and I'm not sure if Forum_account forgot to check src.density there like he does with non-turfs.

Solution:
> mob
> can_bump()
> // if: you're not flying
> // Call the default behavior
> // Return the result
> // else: Return 0 to prevent bumping
> return !flying && ..()
>

That way, you don't even need to use density. You can just check if the player is flying by toggling the 'flying' variable used by the fly() verb.

Thanks for the help but i will be using density cause my FLY code is based on Density like
mob/verb/Land()
if(!src.density) src.density=1;src.icon_state=""
In response to Lord Kakarot
You're welcome.

Also, your code will reset icon_state even if the person isn't flying. I'm not sure if that's what you want, but it probably doesn't matter much.
that is fine i will just create a proc contains that info, tnx