Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-28-2012, 10:14 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Pushing players at an angle.

I'm trying to work on something where players who are in a certain vicinity to the player will be pushed away according to their distance and position to the player. I've managed to figure out a very simple method of doing so, but it's not as effective as I think it could be and only pushes in four directions according to my player's direction. The image attached will hopefully explain it better than I have, but if anybody could lend me a hand, I'll greatly appreciate it.
Attached Thumbnails
Click image for larger version

Name:	bluedirpic.PNG
Views:	162
Size:	97.1 KB
ID:	54303  
__________________
Reply With Quote
  #2  
Old 02-28-2012, 10:40 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Calculate the angle, move player based on that angle.

PHP Code:
temp.angle getangle(player.other.xplayer.other.y);
player.+= cos(temp.angle);
player.-= sin(temp.angle); 
__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.