Login | Register

Level System

August 28, 2007, 13:12 by death-droid
[loading]
-->
I made this code in my spare time i felt it nice to give something to the community so here it is.



//Create Event Of Human Controlled Character
global.health=10
global.lvl=1
global.xp=0
global.attack=1

////Code Written By Death-Droid////
///step event of Human controlled dude///
if global.xp>50*global.lvl{global.lvl+=1;global.xp=0 if floor(global.lvl/2)=global.lvl/2 then attack+=1 else global.health=+1}

////Death Event Of Enemy////

if global.enemy<global.lvl and Ehealth<0 then if floor(random(4))=0 {
global.xp+=4
}
else if global.enemy>global.lvl and Ehealth<0 then if floor(random(4))=0 {
global.xp+=6
global.xp+=15
}
else if global.enemy=boss and Ehealth<0 then if floor(random(4))=0 {
global.xp+=50
}
else if global.enemy=true and Ehealth<0 then if floor(random(4))=0 {
instance_create(ENEMY.x,ENEMY.y,gold)
instance_create(ENEMY.x,ENEMY.y,gold)
}

//create event of enemy//
global.enemy=true
//for boss put
global.enemy=boss
Ehealth=//amount of health


If you need help with anything in this script post below and please tell me if you want me to put a block on the lvl so you can go past a specific lvl.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games