Thread: Projectiles
View Single Post
  #2  
Old 12-13-2008, 04:05 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Basicly you can start with making a serverside class that handles movement (either by using move() or x,y altering using cos and sin) and acts like a projectile.

And to cast it, simply do something like..

PHP Code:
function onCastProjectile(levelxyanglespeed) {
  
with(findlevel(level).putnpc2(xy"")) {
    
this.angle angle;
    
this.speed speed// tiles per 0.1 sec
    
this.join("custom_projectile");
  }

But beware to use destroy(); inside the class when it hits a player or a wall (Use custom checks for that) so it's properly destroyed

This is just an idea of how you can do it. If others have an other suggestion of how to do it, they can post that.
__________________
Reply With Quote