There are a lot of ways ot make your bullets move.
The simplest way is to do the following:
Point your bullet in the direction you want it to go, and then use moveentity to move it in a positive Z direction.
The Z axis, when in object space, not world space, which is what you are in when using moveentity, is the axis which points in the direction your object is facing, assuming you pointed the mesh in the right direction when you created it.
If you use the above code, then you would do this to make all your bullets move:
[code
BulletSpeed# = 1.0
For Bullet.Playerbullet = Each Playerbullet
MoveEntity p1\entity, 0, 0, BulletSpeed#
Next
[/code]
Also in that loop you would check to see if the bullet has collided with anyhting. And if it has, you would delete the bullet, and then decrement the health of the object that was hit. Or destroy it. You would also play an explosion noise, and display an explosion. Which itself might be animated with a for loop looking at all explosions that you have created and animating them until they reach their last frame and then doing FreeEntity ThisExplosion\Entity and Delete ThisExplosion.
Even better would be if you calculate dhow many seconds a frame took to render (less than 1 in most cases) and then multiplied your bullet's speed by that. So the bullet speed would be how far the bullet moves in a second, and the "deltaseconds#" would modify that so the bullet only moves 1/10th that distance if you are running at 10 frames per second. This is how you make your game run at the same speed on every system. Or you can use frame tweening, like in the castle demo, but personally I find frame tweening to be overly complicated and I don't use it myself. The only real advantage of it is you can play back demos and if you're doing really advanced stuff it might get you a few extra FPS, or make your physics a little more stable, or help with network play. But I have done physics and network play without it. Using it makes a lot of stuff a real pain to do.
The simplest way is to do the following:
Point your bullet in the direction you want it to go, and then use moveentity to move it in a positive Z direction.
The Z axis, when in object space, not world space, which is what you are in when using moveentity, is the axis which points in the direction your object is facing, assuming you pointed the mesh in the right direction when you created it.
If you use the above code, then you would do this to make all your bullets move:
[code
BulletSpeed# = 1.0
For Bullet.Playerbullet = Each Playerbullet
MoveEntity p1\entity, 0, 0, BulletSpeed#
Next
[/code]
Also in that loop you would check to see if the bullet has collided with anyhting. And if it has, you would delete the bullet, and then decrement the health of the object that was hit. Or destroy it. You would also play an explosion noise, and display an explosion. Which itself might be animated with a for loop looking at all explosions that you have created and animating them until they reach their last frame and then doing FreeEntity ThisExplosion\Entity and Delete ThisExplosion.
Even better would be if you calculate dhow many seconds a frame took to render (less than 1 in most cases) and then multiplied your bullet's speed by that. So the bullet speed would be how far the bullet moves in a second, and the "deltaseconds#" would modify that so the bullet only moves 1/10th that distance if you are running at 10 frames per second. This is how you make your game run at the same speed on every system. Or you can use frame tweening, like in the castle demo, but personally I find frame tweening to be overly complicated and I don't use it myself. The only real advantage of it is you can play back demos and if you're doing really advanced stuff it might get you a few extra FPS, or make your physics a little more stable, or help with network play. But I have done physics and network play without it. Using it makes a lot of stuff a real pain to do.