Quote:
|
Originally Posted by jake13jake
onwater/onwater2 checks for lava and water tiles
onwall/onwall2 checks for anything that should be blocking according to the default system (includes players/npcs).
onwall(x,y) tells you if the specified coordinate is blocked
onwall2(x,y,w,h) tells you if there is anything blocking within the specified area
|
That is pretty much exactly what I said, except you tried to add the 'players/npcs' thing, but left something out. If it is a no playerkilling zone (or the noplayersonwall() function is called, players are not counted as blocking.)
Quote:
|
Originally Posted by jake13jake
a little bit of redundancy here.
onwall2(player.x,player.y+1,1/16,2)==true
true == true returns true
false == true returns false
so you can just do: if (onwall2(x,y,w,h))
otherwise it would be doing a double comparison, which should be avoided, although it really won't matter much unless you're doing a long for loop or something.
|
It's not redundancy. You are not doing double comparisons. That is the
exact same thing as if you leave it out.