Velocity
Member
Hey,
So I'm making a Fighting Game like Street Fighter...
And IN it, I have an "arcade ladder", where you fight different characters as the game progresses.
But I'm having a problem, where it's spawning the wrong character for the room it's currently in.
So I made an arcade ladder controller, and in its create event, I have:
// Start of level (create)
if (room != rm_intro)
{
global.level = -1;
for(var i = 0; i < array_length_1d(global.rooms); i++)
{
if(room == global.rooms)
{
global.level = i;
break;
}
}
instance_create(512,288, global.enemies[global.level]); //if global.level == -1, you are in a room where nothing is coded to spawn.
}
And then, in its game start event, I have this:
// Start of game
global.enemies[0] = obj_itachiE;
global.rooms[0] = rm_battle ;
global.enemies[1] = obj_nejiE;
global.rooms[1] = rm_hong_kong ;
global.enemies[2] = obj_narutoE ;
global.rooms[2] = rm_light_house ;
global.enemies[3] = obj_kakashiE;
global.rooms[3] = rm_saji_mansion ;
global.level = 0;
obj_narutoE stands for obj Naruto ENEMY...
So I have an enemy parent object that selects the enemy object to act as the enemy in a fight.
So my PROBLEM is, that in rm_saji_mansion, INSTEAD of having obj_kakashiE as my enemy... I have obj_narutoE... And I can't seem to figure out how to CHANGE it...
I ALSO wanted to switch obj_itachiE around with obj_narutoE, and have obj_itachiE in rm_light_house, and obj_narutoE in rm_battle... But I can't seem to do THAT, either... Because last time I tried, I got error messages...
But also, as experimentation, I've also made things like:
An object named obj_globalenemyequalsnaruto
Where, in the create event, I have:
global.enemy = obj_narutoE
Or another object, named:
Create_Naruto
And in it's room end event, I have:
instance_create(512,288,obj_narutoE);
And these objects are scattered about in different rooms...
Can anyone help me?
Cheers.
So I'm making a Fighting Game like Street Fighter...
And IN it, I have an "arcade ladder", where you fight different characters as the game progresses.
But I'm having a problem, where it's spawning the wrong character for the room it's currently in.
So I made an arcade ladder controller, and in its create event, I have:
// Start of level (create)
if (room != rm_intro)
{
global.level = -1;
for(var i = 0; i < array_length_1d(global.rooms); i++)
{
if(room == global.rooms)
{
global.level = i;
break;
}
}
instance_create(512,288, global.enemies[global.level]); //if global.level == -1, you are in a room where nothing is coded to spawn.
}
And then, in its game start event, I have this:
// Start of game
global.enemies[0] = obj_itachiE;
global.rooms[0] = rm_battle ;
global.enemies[1] = obj_nejiE;
global.rooms[1] = rm_hong_kong ;
global.enemies[2] = obj_narutoE ;
global.rooms[2] = rm_light_house ;
global.enemies[3] = obj_kakashiE;
global.rooms[3] = rm_saji_mansion ;
global.level = 0;
obj_narutoE stands for obj Naruto ENEMY...
So I have an enemy parent object that selects the enemy object to act as the enemy in a fight.
So my PROBLEM is, that in rm_saji_mansion, INSTEAD of having obj_kakashiE as my enemy... I have obj_narutoE... And I can't seem to figure out how to CHANGE it...
I ALSO wanted to switch obj_itachiE around with obj_narutoE, and have obj_itachiE in rm_light_house, and obj_narutoE in rm_battle... But I can't seem to do THAT, either... Because last time I tried, I got error messages...
But also, as experimentation, I've also made things like:
An object named obj_globalenemyequalsnaruto
Where, in the create event, I have:
global.enemy = obj_narutoE
Or another object, named:
Create_Naruto
And in it's room end event, I have:
instance_create(512,288,obj_narutoE);
And these objects are scattered about in different rooms...
Can anyone help me?
Cheers.