• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Very short shots - Disparos muy cortos

TheouAegis

Member
Code:
Create event:

shots = 0;

Code:
Shot Key Event:

if !alarm[0] {
 instance_create(x,y,bullet);
 alarm[0] = 10;

Code:
Alarm 0 event:

shots += 1;
if shots == 3
{
 alarm[0] = 30;
}
else if shots == 4
{
 shots = 0
}

Code:
Shot Key Released:

shots = 0;
alarm[0] = 30- alarm[0];
 
Z

ztvmark

Guest
instance_create(x,y,bullet);
In version 2 does not work instance_create is instance_create_layer

Resuelto - Solved

Code:
//Crear un objeto player e importarlo al room

//Add Event Create
disparos_blue_laser = 0;                    //Variable iniciada para evitar errores
segundos_entre_disparos_blue_laser = 0.5;    //Segundos que habra entre disparos aqui medio segundo

//Tiempo que habra entre disparos ya calculado
tiempo_disparos_blue_laser = 30*segundos_entre_disparos_blue_laser;


//Add Event Alarm0
disparos_blue_laser++;


//Add Event Step
// If Key Down     //Si presiona la tecla de espaciado
var l1A5E3514_0;
l1A5E3514_0 = keyboard_check(vk_space);
if (l1A5E3514_0)
{
    //Y si el contador de alarma es 0
    if(alarm[0] == -1) {

        //Le asigna a alarm[0] el valor de tiempo_disparos_blue_laser
        alarm[0]=tiempo_disparos_blue_laser;

        //Crea el disparo
        instance_create_layer(x+0, y+0, "Layer_player", obj_blue_laser);
    }
}
 
Top