Projeto jogo GM
controleObj
evento create
///variavel tempo
tempo = 0;
tempoSegundos = 0;
tempoMinutos = 0;
//instanciamento do player
instance_create( 320, 448, playerObj)
tempo = 0;
tempoSegundos = 0;
tempoMinutos = 0;
//instanciamento do player
instance_create( 320, 448, playerObj)
evento Draw
draw_text(96, 32, tempo);
draw_text(64, 32, tempoSegundos);
draw_text(32, 32, tempoMinutos);
draw_text(64, 32, tempoSegundos);
draw_text(32, 32, tempoMinutos);
evento step
tempo += 1;
// se o tempo receber o valor 30
if (tempo = 30){
tempoSegundos += 1;
tempo = 0;
}
//minutos
if(tempoSegundos = 30){
tempoMinutos +=1;
tempoSegundos = 0;
}
// se o tempo receber o valor 30
if (tempo = 30){
tempoSegundos += 1;
tempo = 0;
}
//minutos
if(tempoSegundos = 30){
tempoMinutos +=1;
tempoSegundos = 0;
}
playerObj
Evento Step
///movimentação
if(keyboard_check(vk_left)){
x -= 8
}
if(keyboard_check(vk_right)){
x += 8
}
//restição de movimento e limite da room
if(x<0){
x=0
}
if(x>608){
x=608
}
//atirar
if(keyboard_check_pressed(vk_space)){
instance_create(self.x +16 ,self.y ,tiroObj)
}
if(keyboard_check(vk_left)){
x -= 8
}
if(keyboard_check(vk_right)){
x += 8
}
//restição de movimento e limite da room
if(x<0){
x=0
}
if(x>608){
x=608
}
//atirar
if(keyboard_check_pressed(vk_space)){
instance_create(self.x +16 ,self.y ,tiroObj)
}

Comentários
Postar um comentário