S
SlFinn
Guest
I have now been using Game Maker and learning to code in GML for 3 days. Someone else on here helped me with something before so I am hoping someone can help with this.
I have tried to code a laser bullet to shoot from my ship, but when I press the space bar that I have assigned to shoot the bullet from the ship, all it does is appear on screen. The bullet does not move at all. I will post below the code I have tried to use.
Please could you tell me where I have went wrong and what I need to do to fix it? I would very much appreciate it!
Within the oPlayer step event script:
Within my obj_bullet create script:
I have tried to code a laser bullet to shoot from my ship, but when I press the space bar that I have assigned to shoot the bullet from the ship, all it does is appear on screen. The bullet does not move at all. I will post below the code I have tried to use.
Please could you tell me where I have went wrong and what I need to do to fix it? I would very much appreciate it!
Within the oPlayer step event script:
GML:
if keyboard_check_pressed(vk_space) {
bullet = instance_create_layer(x + 10, y - 5, "Instances",obj_bullet);
}
Code:
speed = 5;