![]() |
playertouchsme problem
I'm working on an event where basically you're falling down a shaft and you have to dodge these spikes that randomly place themselves while you fall...However, I used onPlayerTouchsme() without knowing the player had to be facing the object z.z
The player needs to die when touching the spike, regardless of their direction! Is there anything I can do to get around this? PHP Code:
|
PlayerTouchesme actually initiates when the player actually touches the NPC. And that only happens when the player is moving(pressing a key) and connects... not when the player and object hit each other.
You'll have to run a timeout and check for when the player is in the proper coordinates. |
SOUNDS COOOOL.
I don't know the syntax for GS2, but you could use something like playerx in |x,x2| && playery in |y,y2| |
I would probably do something like
PHP Code:
PHP Code:
PHP Code:
|
for Era?
[The Class] HTML Code:
function onCreated() { |
Try not to make anyone angry with poor collision detection. So far everyone in this thread have suggested a rectangle, which might now make a spike justice.
|
Umm... serverside code for this Sid? Terrible, and CBK might be complicating things too much.
Logical steps people Things we need to do: - Init things - timeout start - Spawn a spike? --- Random check for spike --- Check to see if the spawning rate should change - update spike positions - check for player collisions --- do what happens when player collides. - timeout PHP Code:
|
PHP Code:
And that script would fill up the box, probably not what you want. *Bored* |
ahh, using showimg, good idea
|
| All times are GMT +2. The time now is 06:47 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.