So... I seek but I do not find an explanation simple...
ITimer the time functiun !
How make a clock (10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0!!!! Explosion for exemple)
In FPS, I try to use SetTime(x?) when I puch 'P', but when I puch 'P', my camera go in the place of x? seconde ago... (return towards the past)
How turn SetTime() ?
------------
timer->start();/stop();
What use this function...
The rest if is importante
__________________________
So, the context of my application :
I puch 'P',
If (Gv==0){
Gv =1
Gravity = -1
(Clock : 5,4,3,2,1,0!!!)
Gravity = 1
Gv=0
}
Help me, thx
How do turn Itimer
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
if i understand your question, then what you want is to start a timer...
well i have made class timer for myself to deal with timer... maybe this might hep
to use this timer class make sure you call variable.declare(); first or the game will crash
HOPE THIS HELPS!
well i have made class timer for myself to deal with timer... maybe this might hep
Code: Select all
class Timer
{
public:
void declare()
{
irrTimer = mainmenu->getTimer();
irrTimer->getTime();
}
void set(int timeout)
{
beginTime = irrTimer->getTime();
interval=0;
interval = timeout;
}
void start()
{
beginTime = irrTimer->getTime();
interval = 0;
}
bool alarm()
{
int now = irrTimer->getTime();
if((now - beginTime)>=interval)
{
return true;
}
else{return false;}
return true;
}
int stop()
{
int now = irrTimer->getTime();
interval = (now-beginTime);
return interval;
}
int check()
{
int now = irrTimer->getTime();
interval = (now-beginTime);
return interval;
}
void reset()
{
beginTime = 0;
interval = 0;
}
private:
int beginTime;
int interval;
ITimer* irrTimer;
};
HOPE THIS HELPS!
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
i updated the class a bit
SO USE THIS ONE INSTED OF THE ONE ABOVE... THIS CLASS HAS THE AME CONCEPT THOUGH
SO USE THIS ONE INSTED OF THE ONE ABOVE... THIS CLASS HAS THE AME CONCEPT THOUGH
Code: Select all
class Timer
{
public:
void declare()
{
irrTimer = mainmenu->getTimer();
irrTimer->getTime();
}
void set(int timeout)
{
beginTime = irrTimer->getTime();
interval=0;
interval = timeout;
}
void start()
{
beginTime = irrTimer->getTime();
interval = 0;
}
bool alarm()
{
int now = irrTimer->getTime();
if((now - beginTime)>=interval)
{
return true;
}
else{return false;}
}
int stop()
{
int now = irrTimer->getTime();
interval = (now-beginTime);
return interval;
}
int check()
{
int now = irrTimer->getTime();
interval = (now-beginTime);
return interval;
}
void reset()
{
beginTime = 0;
interval = 0;
}
private:
int beginTime;
int interval;
ITimer* irrTimer;
};
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
Ok!
I'm french and I don't understand english very well (and the code).
So, You confirm my said:
->This code replace the ITimer (start(), stop(), ...) ?!
->This code add alarm() (and other but I don't know) ?!
->For regulate the Timer, I must modify 'interval' ???
And if you can confirm : if this functiun can use like this :
__________________________________________________
...Puch P...
if (alarm() == 0){
irrTimer->start();
Gravity = -1
if(alarm() == 1){ //<= It's possible ?
Gravity = 1
irrTimer->stop();
irrTimer->reset();
} else {
}
___________________________________________________
I'm sorry for ask question on C++
W
I'm french and I don't understand english very well (and the code).
So, You confirm my said:
->This code replace the ITimer (start(), stop(), ...) ?!
->This code add alarm() (and other but I don't know) ?!
->For regulate the Timer, I must modify 'interval' ???
And if you can confirm : if this functiun can use like this :
__________________________________________________
...Puch P...
if (alarm() == 0){
irrTimer->start();
Gravity = -1
if(alarm() == 1){ //<= It's possible ?
Gravity = 1
irrTimer->stop();
irrTimer->reset();
} else {
}
___________________________________________________
I'm sorry for ask question on C++
W
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
Not exactly
hop this helps and don't worry.. ask as many questions as you want
Code: Select all
Timer timer //make a variable of the class timer
timer.declare(); // you have to do this first or it will crash
timer.set(1000); //you set the time 1000 = 1 sec ... it goes in 1000s
timer.stop(); // stop the timer because we have to do something before
Gravity = 1; // START THE JUMP
timer.start(); //NOW START THE TIMER
if(timer.alarm()==true) // if timer done then
{
gravity = -1; //PUT GTRAVITY BACK ON
}
/////////////////////////DONE ///////////////////////////////////////
hop this helps and don't worry.. ask as many questions as you want
Last edited by killzone721 on Sun Mar 19, 2006 2:03 pm, edited 1 time in total.
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
last post might be too UNCLEAR
here the code without documentation
here the code without documentation
Code: Select all
Timer timer
timer.declare();
timer.set(1000);
timer.stop();
Gravity = 1;
timer.start();
if(timer.alarm()==true)
{
Gravity = -1;
}
HOPE THIS HELPS :wink:
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm