FANDOM


Source code for my RPG on Gamejolt as of beta 1.0 (using Game Maker Studio)

pics:

spr_player

spr_wall

spr_expr

Scripts:

scr_find_depth:

depth = y*-1;

objects:

obj_player w/ spr_player:

step/code:

if(keyboard_check(vk_right) && place_free(x+4,y)) then {     x+=4; } else if(keyboard_check(vk_left) && place_free(x-4,y)) then {     x-=4; } else if(keyboard_check(vk_down) && place_free(x,y+4)) then {     y+=4; } else if(keyboard_check(vk_up) && place_free(x,y-4)) then {     y-=4; }

step/run script:

scr_find_depth();

collision with obj_expr code:

global.expr+=1; with(other) {     instance_destroy(); }

obj_wall with spr_wall:

create/script

scr_find_depth();

obj_draw_text

create:

version = "beta 1.0"

name = "Stick Life RPG"

draw:

draw_text(x,y+11,version); draw_text(x,y,name);

obj_expr with spr_expr: Nothing just an object, thought important!

obj_globals(must be in your room):

create/code:

global.level = 1; global.hp = 10; global.maxhp = 10; global.expr = 0; global.maxexpr = 2;

step/code(Leveling System):

///Leveling System if global.expr == global.maxexpr then { global.level +=1; global.expr = 0; global.maxexpr +=2; global.hp +=5; global.maxhp +=5; }

step/code(Death at Low hp):

///Death of Low hp if global.hp == 0 then { show_message("You died of low health! Your level were: " + string(global.level)) global.expr = 0; global.maxexpr = 2; global.level = 1; global.maxhp = 10; global.hp = 0; }

obj_stats(must be in your room):

draw/code:

draw_text(x,y,"level: " + string(global.level)); draw_text(x,y+16,"HP: " + string(global.hp) + "/" + string(global.maxhp)); draw_text(x,y+32,"EXP: " + string(global.expr) + "/" + string(global.maxexpr));

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.