magic. i made magic.
that blue bar represents mana, it recharges over time due to this code in the step event.
if (mana < maxmana){
if instance_number (obj_magic_missile) = 0 {
mana=mana+10;
}
}
and you can only fire off one bolt every quarter of a second or so, due to this code, also in a step event.
if (magictimer > 0)
magictimer = magictimer-1;
if (magictimer < 0)
magictimer = 0;
and that works in conjunction with the code that actually creates the magic instance, in a global left mouse button event.
if weaponnumber = (2){
if (mana > 19){
if magictimer = 0{
instance_create (x,y, obj_magic_missile){
mana = mana-75
magictimer = 15;
}
}
}
}
that weaponnumber variable is basically a scale in which i can set 10 settings to, any more and i run out of number buttons.
all of this makes a little purple thing go pew pew.
No comments:
Post a Comment