Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 08-23-2001, 10:54 PM
Guest
Posts: n/a
I like mine better It had stars going behind it but i took it out, it looked weird.
NPC Code:

function drawstars()
{
onlyoncevar+=1;
if(onlyoncevar==1)
{
this.savedx=players[player].x;
this.savedy=players[player].y;
}
if(playery+5 < this.savedy || playery-5 > this.savedy)
this.savedy=playery;
if(playerx+5 < this.savedx || playerx-5 > this.savedx)
this.savedx=playerx;

if(this.savedx != players[player].x)
{

players[player].x=((players[player].x-this.savedx)*3)+this.savedx;
if(onwall(playerx+1.6, playery) || onwall(playerx, playery))
players[player].x=this.savedx;
this.savedx=players[player].x;
}
if(this.savedy != players[player].y)
{
// if (onwall(playerx, ((players[player].y-this.savedy)*3)+this.savedy)) // Y movement runs you into wall
// {}else
{

players[player].y=((players[player].y-this.savedy)*3)+this.savedy;
if(onwall(playerx, playery+1.8) || onwall(playerx, playery-.2))
players[player].y=this.savedy;
this.savedy=players[player].y;
}
}
// if(playerx > 58 || playerx < 4 || playery > 58 || playery < 4) //Reached the edge of the map. Does strange things. :|
// {
// umokison=0;
// onlyoncevar=0;
// }
sleep .05; // Run every frame.
if(this.umokison==1) // Only if toggled.
{
drawstars();
}
}
if(playertouchsme)
{
toweapons Umok Boots;
hide;
}
if(weaponfired)
{
if(this.umokison==0)
{
this.umokison=1;
myy=players[player].y;
myx=players[player].x;
mydir=players[player].dir;
players[player].sprite=24;
drawstars();

}
else
{
this.umokison=0;
onlyoncevar=0;
}


Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:51 AM.


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