How to make spiral missiles in DECORATE without a billion lines of code.
Posted: Thu Apr 30, 2015 8:16 am
I decided to make a tutorial based around the fact that Zandronum FINALLY added user variables into DECORATE, which can reduce the size of the DECORATE lump by quite a bit. I'll just be making a basic DoomImpBall spiral.
First off, make your monster (except for the missile part).
Before you make the states though, you will have to add this to your monster initiation part.
Then, for the missile part, just modify this to your liking.
And if you want an instant circle, change DEL to 0. Thank you, and good night.
First off, make your monster (except for the missile part).
Before you make the states though, you will have to add this to your monster initiation part.
Code: Select all
var int user_angle;
Code: Select all
//SPRI A = Your Sprite
//DEL = Delay of projectile firing
//SPHEIGHT = Height of projectile spawning
//DIVIDE = Chooses how many projectiles you want spawned in the spiral. (360/DIVIDE amount of projectiles)
//PROJ = Your Projectile
Missile:
SPRI A 0 a_setuservar(user_angle,0)
//add something like an animation on this line if you want
Missile2:
SPRI A DEL a_custommissile("PROJ",SPHEIGHT,0,user_angle,cmf_aimdirection,0)
SPRI A 0 a_setuservar(user_angle,user_angle+DIVIDE)
SPRI A 0 a_jumpif(user_angle <3 60,"Missile2")
//add another animation if you want
goto See