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.

Author
Message
Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 13th Oct 2010 00:08
Ok so I have a new assimgnt, I have to make a Rhythm based first person flight sim in a tunnel... I know right. Im pretty sure I can get most of it but the Rhythm. What needs to happen is, the character builds up speed when the player mainains a Rhythm with the left and right mouse buttons. The Rhythm has to slowly get faster and faster.

That seems to be the only issue im having so far, any ideas?
Master Man Of Justice
16
Years of Service
User Offline
Joined: 13th Feb 2008
Location: Between Insanity and Intelligence
Posted: 13th Oct 2010 06:28
hmmm i think the only hard part (for me at least) would be coding the lee-way between button misses. (your not going to hit it perfectly every single time).

I dont know how i would go about coding that.

Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 14th Oct 2010 10:44
This is a diffrent issue but for the same game "by the way any help on the first issue would be great"

So the player is flying in a tunnel or cave, I have colliosn detection working but Im trying to make the player bounce off the walls instead of going through.



I know it works because the health goes down and the fog turns red. But the camera is still able to go through the walls. Higher in the code there is a float called speed that governs the speed. Any help would be AMAZING!
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Oct 2010 12:29
Collision is generally complicated, and it sounds like you want to do physics-y stuff too.

If I needed to do what you're describing, I would take the normal of the collision, multiply that by the magnitude of the collision, and then subtract that from the player's velocity. If you know what I mean, great! Otherwise... Iunno how else to do it. Maybe someone else can enlighten you


As for the rhythm thing, here ya go!

(press the left and right key around the time the number reaches 1000)

timer() returns the time in ms. I'm not too sure what significance the value of it has (some big number like 23413792), but the difference between two calls of timer() is the time in ms between the calls.

Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 14th Oct 2010 13:34
This is great! thank you very much, my only question is how do I give it some more le-way? it seems to be to sensitive least for me but over all VERY nice thanks
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Oct 2010 21:57
just look at how it calculates the score

Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 15th Oct 2010 01:23
The nice part the says "proximity" dah! lol Nice when I read things not just glance over it, thanks again
Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 16th Oct 2010 07:23
Hey iv got another issue sorry Im trying to make the player loose points for taking to long to click, Iv tried this afew ways but nothing seems to be working.
I tried


And I also tried



but nothing works right, the first one doesnt do anything, and the second one gives me HUGE number what cant be right any help would be great
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 16th Oct 2010 09:31
Quote: "if timer() =range+rate"

like I said, the absolute value of timer() is practically meaningless. I don't know what it represents, and for most uses, its probably useless.
what timer() is good for is the DIFFERENCE in the value of timer() since the last call.

What you want to do is subtract points if the change in time is greater than a certain value. So take the time elapsed since the player last clicked, and if its greater than rate+range, subtract points.

Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 17th Oct 2010 04:15
But how do I get timer to see if its diffrent? Thats what im trying to do. Im trying to make a vaule the records the old time so that I can check old time plus range and rate then compair it to current time. But I cant nothing records time properly
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Oct 2010 18:13 Edited at: 17th Oct 2010 18:13
give a variable t the value of timer()



To check the time passed, take the variable t from timer() and it will return the number of milliseconds.



This code checks if a second has passed. There are 1000 milliseconds in one second. Of course, you will have to adapt this to your own uses.

Camronas
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 18th Oct 2010 04:29
This is what I have, I can used "t" becasue it returns with an arbitray number. I am lost on what to do and yes I should comment more often but you get that.

Login to post a reply

Server time is: 2024-09-28 22:23:45
Your offset time is: 2024-09-28 22:23:45