DreemyChara
Member
I made this command unfotunately it doesnt seems to understand the obj as a final argument but it doesnt send an error so it might work and i made a mistake or it absolutely doesnt and im screwed...
knowing that the global.tile_sprite is defined here
Code:
if (mouse_check_button_released(mb_left)) {
state = states.walking
if (instance_exists(Goal)) {
instance_destroy(Goal)
}
instance_create_layer( mouse_x, mouse_y, layer, Goal)
var Player_path = path_add()
show_debug_message(global.tile_sprite)
mp_potential_path_object(Player_path, Goal.x,Goal.y,3,4,global.tile_sprite > 1)
path_start(Player_path, 3 , path_action_stop, false)
}
Code:
var tiledata, screenX, screenY, tileindex, tileZ;
for (var tX = 0; tX < Map_w; tX++)
{
for (var tY = 0; tY < Map_h; tY++)
{
tiledata = global.theMap1[# tX, tY];
screenX = Script2(tX, tY);
screenY = Script3(tX, tY);
tileindex = tiledata[tiles.sprite];
tileZ = tiledata[tiles.Z];
if (mouse_check_button_pressed(mb_left))
{
if (screen_to_tile_x(mouse_x,mouse_y)== tX) && ((screen_to_tile_y(mouse_x,mouse_y) == tY) )
{
tile_get_index(tileindex)
global.tile_sprite = tileindex
}
}
if (tileindex != 0) { draw_sprite(tile,tileindex - 1 , screenX, screenY + tileZ)}
}
}