1
Graphics / Spawning bullets
« on: May 02, 2012, 07:35:35 am »
Been messing around with SFML a little lately. Anyways, I want to know a simple way how to spawn a bullet and have it move across the screen without having to hold a key down. I know this is simple, it's late, and i'm sort of a noob; but here:
I have the sprite class made and the sprite spawning from the right location. When the "space" key is tapped I want the bullet to move across the screen to the right. The only way it will do this now if the space is held.
Inside while app.isopen loop:
if (App.GetInput().IsKeyDown(sf::Key::Space)) {
Bullets.Move(100 * .1, 0);
}
This is flying right over my head, no idea why. Any help?
I have the sprite class made and the sprite spawning from the right location. When the "space" key is tapped I want the bullet to move across the screen to the right. The only way it will do this now if the space is held.
Inside while app.isopen loop:
if (App.GetInput().IsKeyDown(sf::Key::Space)) {
Bullets.Move(100 * .1, 0);
}
This is flying right over my head, no idea why. Any help?