GameMaker: Studio

GameMaker: Studio

Finn, spill og lag spill enkelt
Oppdag, vurder og last ned de beste spillerskapte spillene laget i GameMaker: Studio helt gratis. Eller prøv å lage ditt eget og del det med samfunnet. Trykk her for å finne ut mer.
bluetooth 2 21. feb. 2013 kl. 16.04
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.
< >
Viser 13 av 3 kommentarer
Louen 22. feb. 2013 kl. 14.15 
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.
bluetooth 2 22. feb. 2013 kl. 22.52 
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. feb. 2013 kl. 8.39 
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...
Sist redigert av Louen; 23. feb. 2013 kl. 8.40
< >
Viser 13 av 3 kommentarer
Per side: 1530 50