R
royer14
Guest
Hello again, as I am new the forum allows comment after 5 publications, so I thank them to those who help with my doubts, without more.
I have a Player object, Shooting object
In the player object I have added in the create event a script that does the actions that the player must do separately, with that I include the collision and some basic functions.
inside the player object I write this
it means that it starts at 1
event keyboard press <right>
add script
event keyboard press <left>
add script
Once I have created a variable, now I go to the player's script and I make an action when I press the spacebar key, the action of creating an instance of a trigger effect, not being screened in the same player script, I linked to another script:
player movement script
create script shooting only to shoot.
Now where can I change the orientation of the image, inside the o_efx_shot, or some other idea?
When I say orientation I refer to image_xscale
I have a Player object, Shooting object
In the player object I have added in the create event a script that does the actions that the player must do separately, with that I include the collision and some basic functions.
inside the player object I write this
Code:
dir_right =1;
event keyboard press <right>
add script
Code:
dir_right = 1
add script
Code:
dir_right = -1
player movement script
Code:
///move player and collision
/* I omit the rest of the code
*/
var shooter = keyboard_check(vk_space);
if (shooter)
{
shooting();
}
Code:
if (dir_right =1)
{
particle_disp = instance_create(o_player.x+63,o_player.y +64,o_efx_shot); //o_efx_shot particle sprite
particle_disp.direction = 0;
particle_disp.speed = 12 ;
}
if (dir_right = -1)
{
particle_disp = instance_create(o_player.x-81,o_player.y+64,o_efx_shot);
particle_disp.direction = 180;
particle_disp.speed = 12 ;
}
When I say orientation I refer to image_xscale