GameMaker: Studio

GameMaker: Studio

Trouvez, jouez et créez des jeux facilement
Découvrez, évaluez et téléchargez gratuitement les meilleurs jeux créés par d'autres joueurs dans GameMaker: Studio. Ou essayez de créer le vôtre et de le partager avec la communauté. Cliquez ici pour en savoir plus.
Can't get this to work for some reason.
I'm trying to make an object shoot another object to the right, and i'm not exactly sure what i'm doing wrong.
Here's what I have for the create even for the object that shoots:
shoot = 100
attack = false
and here's the step even for the object that shoots:
shoot -= 1
if shoot = 0 {
attack = true
}
if attack = true {
ID=instance_create(x,y,obj_bullet)
ID.direction=0
ID.speed=4
}
if shoot < 0 {
attack = false
}
Any help would be much appreciated.
< >
Affichage des commentaires 1 à 3 sur 3
Louen 22 févr. 2013 à 14h15 
Mmmm, well I put it in a test and it worked fine for me. Shot to the right after 100 steps. However it did shoot twice. But being that the problem is you cant get it to shoot at all well I am pretty new to this so cant offer much help. I messed with it a bit but cant figure out whats wrong, it must be a problem with somthing else, this seems to work fine, one thing maby it is working but the "Bullet" is in the background behind some other objects? Sorry I can't be of much help, if I think of anything I will let you know.
That seems really weird. But since You got it to work, can you show any images of it by chance? I'm actually curious as to how it acts.
Louen 23 févr. 2013 à 8h39 
I would, but I just cant seem to get a good picture onto Steam. But to sumarise it moves right at a speed of 4, it makes 2 bullets the second is 4 pixls behind the first, I was able to fix this by moving the attack = false under the ID.speed=4, and deleating if shoot < 0 block.

Now you might try moving the "Direction & Speed" to the bullet itself, under the create event. Maby the "ID" is messing with your script. If I get a good picture I will post it but, its pretty simple, the bullet was a circle and the shooter was a squair...
Dernière modification de Louen; 23 févr. 2013 à 8h40
< >
Affichage des commentaires 1 à 3 sur 3
Par page : 1530 50