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 01-28-2002, 12:37 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
NPC Code:

// NPC made by Lord Helmut
// Shortened by Kyle0654
// 255x144 width=63 height=48

if (created) {
this.dirgo = {0,2,1,3};
this.hearts = 5;
this.speed = .5;
this.x = x;
this.y = y;
setimgpart #f,0,0,63,48;
}

if (playerenters||timeout) {
i = int(random(0,3.9));
swim();
timeout = 3;
}

function swim() {
for (this.z = 0; this.z < 9; this.z++) {
setimgpart b_piranah.png,63*(this.dirgo[i]),48*((10-this.z)%3),63,48;
sleep .3;
}
}


You'll of course need some code for actually moving it...and I'd suggest rearranging your sprite set to eliminate the need for the dirgo modifier.
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 03:07 AM.


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