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.

DarkBASIC Discussion / making a shooting guy

Author
Message
bigfish58
20
Years of Service
User Offline
Joined: 25th Dec 2004
Location:
Posted: 26th Dec 2004 18:07
hi

i am making a shoot em up game and i have a 3rd person person camera, at the moment i have a terain the 3rd person camera and walls and wall collisions, but i want to know how to make the 3rd person camera (preferably the palyer character) to have a gun in a hand like in halo or some thing (got me so far?) and when like CTRL is press a bullet comes out the gun, if any one could help me here i would be very gratefull.

cheers

[email protected]
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Dec 2004 19:50 Edited at: 27th Dec 2004 19:51
if you want a gun+hand to be on screen then you want a first person camera, not third.
here's some pseudo code to make the bullets come out of the gun:

dim bullets(100)
'Array where we'll store how long each bullet has been alive

for b=1 to 100
'Adjust each bullet

bullets(b)=0
'all bullets start off "dead"
hide object b
'Hide all the bullets

next b

And then inside your game loop:
if control has been pressed then
for i = 1 to 100
'Here we search for an inactive bullet

if bullets(i)=0 then
'We've found one!

bullets(i)=1 'Here we activate it
position object i, object position x(gun), (then the same for Y and Z)
rotate object i, object angle x(gun), (so on)
exit for
end if
end if
for i = 1 to 100
'Weather the CTRL key is being pressed or not, we have to move all active bullets forward.
if bullet(i) then
move object i, bulletSpeed
'Move the bullet
inc bullet(i)
'Increase it's age
if bullet(i) > 500 then
bullet(i)=0
hide object i
end if
'if the bullet has been flying for too long, kill it
end if
next i


bigfish58
20
Years of Service
User Offline
Joined: 25th Dec 2004
Location:
Posted: 27th Dec 2004 20:01
thanks for that, i havent tryed it yet but i havent tryed it ill try it in my spare time and let you know if it works


cheers
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 27th Dec 2004 23:03
If what you are trying to do is make it so that the player can hold the gun, i think you should make seperate models of the character in different poses and with different weapons as it is very difficult to actually make it so the model is holding onto the guns if you just use the one model.

the answer to all lives questions is...
... meh!
Ali M Oldboy
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: England, UK
Posted: 27th Dec 2004 23:32
Yeah, very useful


-- Shoot the damn bastard!
bigfish58
20
Years of Service
User Offline
Joined: 25th Dec 2004
Location:
Posted: 28th Dec 2004 00:43
cheers for that, ill keep that in mind, can you recomend and 3d programs i can download for FREE?

cheers
bigfish58
20
Years of Service
User Offline
Joined: 25th Dec 2004
Location:
Posted: 28th Dec 2004 01:01
hi

my friend has just made me a gun, i will provide the code and i would desperatly need someone to make in into a 3rd person camera view, like having the gun on the bottom right of the screen and it goes with you were ever the camera goes, cheers


note the code is in x format

Login to post a reply

Server time is: 2025-05-24 10:47:37
Your offset time is: 2025-05-24 10:47:37