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 / Walking animation for fps.

Author
Message
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 26th Oct 2005 23:40
You know when you are playing a first person shooter and you walk forward the camera kinda moves from side to side in an arc motion.
Does anyone know how to do this in dark bascic classic.
Any help would be great.


BM

Our aim is to keep the loo's clean, your aim can help.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Oct 2005 01:51 Edited at: 27th Oct 2005 01:52
I normally do it with the gun

make two variables... one increasing.. it represents angles, which means it cant be more than 360..

the second being the sine of the first.. then add the second to the y postition of your gun.. or the x position of your camera




Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 13:58 Edited at: 27th Oct 2005 14:11
either I don't understand or this doesn't work.
Hmmm

[edit]No wait it was my fault I placed the function in the wrong part of the code it works fine now and it looks great thanks loads.

BM

Our aim is to keep the loo's clean, your aim can help.
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 15:04
Do you have any code for a first person jump?


Our aim is to keep the loo's clean, your aim can help.
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 27th Oct 2005 15:32 Edited at: 27th Oct 2005 16:27
this is the one I use


posy#= your y position
acc#= your y accereleration
grav#= 5 (but it should be 9.81, depends on the scale)

Don't look at my sig!
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 18:16
It isn't working could you explain a bit more.

Our aim is to keep the loo's clean, your aim can help.
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 18:39
Help from anyone would be great

Our aim is to keep the loo's clean, your aim can help.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Oct 2005 19:43 Edited at: 27th Oct 2005 19:44
acc# = the speed that will make the player go upwards. This means that when acc# = 0.0, the player will not go down or up. When acc# > 0, the player will go up, and when < 0, the player will go down.

When jumping, you increase the acc# by a certain number wich will determine the height of the jump. But as you know, you can only jump when standing on the floor, wich means that you are only able to jump when the posy# = get ground height(1,posx#,posz#). (Player position y = the height of the matrix at coords posx# and posz#).

Beside this, you have to add gravity, wich will pull the player back down. By substracting it from the acc#, you eventually will get an acc# that is < 0: the play will fall down.

Note that when the player hits the ground, the player may not go down or up, wich means the acc# should be 0 unless the player jumps again and restart the whole progress.

Immunity and Annihalation makes Immunihalation...
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 19:52
How can I have the player moving forward whilst jumping?

Our aim is to keep the loo's clean, your aim can help.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Oct 2005 20:04
by using some math for the xposition and zposition of the camera:

for moving:


I edited a little of Link102's code to fit in this program.

Immunity and Annihalation makes Immunihalation...
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 27th Oct 2005 22:03
edit all you like and sorry about the bad explanation, I had to post it in a rush

Don't look at my sig!
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 27th Oct 2005 22:09 Edited at: 27th Oct 2005 22:25
What happens is yeah sure I can jump but I am laying on the ground I want to be Y#+35 not just Y#.
How do I do this without mucking the code up.

Cause when I set it to Y#+35 I end up jumping really high in the air and I have no way to stop jumping it is continueous.

Our aim is to keep the loo's clean, your aim can help.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th Oct 2005 17:28
Well, if you change all the "5"s by "35", you get a view of 35 units above ground...

Immunity and Annihalation makes Immunihalation...
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 28th Oct 2005 17:44
You could also make a variable called PlayerHeight# and replace all the + 5's there by PlayerHeight# ... so when you need to change it, just change the variable's value ^^


http://dbfree.dbspot.com/ <- DB Freebie Archive! Royalty-free media for your games! FREE!

Login to post a reply

Server time is: 2025-05-22 13:41:31
Your offset time is: 2025-05-22 13:41:31