Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help with a FPS game

Author
Message
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 10th Jan 2005 23:32 Edited at: 11th Jan 2005 00:10
Hi

I have a problem with my FPS game that I´m making toghether with KLU 007.
We´re using this code:



But when we try to shoot with the gun, the bullet shows, but it ain´t moving.

Any ideas to solve this problem?

Thank You


looking for Royalty free 3D objects?
then Check PanzerGames at this link : http://www.freewebs.com/panzergames
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 11th Jan 2005 00:52 Edited at: 11th Jan 2005 00:52
your problem is that you only move the bullet object by 5 when you fire the bullet, as you reset the variable Fire to 0 after one loop. this is why your bullet doesn't appear to be moving. To get around this problem, people often use 'life' variables, so the bullet moves for a certain number of loops, and then resets fire when the life is at an end. Here is an example using your code, but it might be a good idea to use an array and have several bullet objects, as at the moment you can only fire one bullet at a time.



Hope this Helps.

Part of solving the problem is actually noticing that the problem is there in the first place

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 11th Jan 2005 01:20
Thanks it works!


Check out PanzerGames at http://www.freewebs.com/panzergames

Login to post a reply

Server time is: 2024-11-27 18:44:57
Your offset time is: 2024-11-27 18:44:57