Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-06-2007, 08:08 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Simple Movement

Here is a good way to move your object in all directions very easily.

PHP Code:
//#CLIENTSIDE  // Makes events all processed on the client comp

function onCreated()  //Action is called when script is read
{

  
disAbleDefMovement();  //Disables Default movement for player
}

function 
onKeyPressedcodechar)  //Called when ever the client pushes a key on the keyboard
{

  
code;  //make k equal the code number of what ever key is pushed

  
player.+= (( == 39) - ( == 37))/16;  //  if k equals number, it is 1, if not it is 0

  //so if the player pushes left arrow it be player.x += 0 - 1;  

  
player.+= (( == 40) - ( == 38))/16;  //same as above just on the y-axis


__________________
Deep into the Darkness peering...
Reply With Quote
 


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 02:45 AM.


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