When i try to create a timer using a counter, whatever button i type in, it will generate an extra frame.
If i try to move the mouse, it increments too.
I find it using a variable and incrementing it.
The code for the timer is this one:
Sorry, I have no idea what you are talking about.
How about posting all the code, or the parts of the code that show the error.
It is not that it doesnt work. If you try this program, when you move your mouse, the frames will increment much faster.
The question is why?
I take the previous edit back, you need to set up a queue.
That code increments counter at each event. Mouse movements generate lots of events, so it is to be expected that counter increases faster.
Use this:
This will stop events other than timer
In your code do this:
Alternatively you could move your frame drawing code into your timer event handler.
Thanks for the help!
The square now runs incredibly smoother!
As i was making some practice by learning all the program by heart... I found a very nice program
Showing coordinates of the square!
This is it with all mods codestepper gave
Personally I'd put the count++ inside the if() at the end there. Since a frame isn't actually drawn till that if is entered, it's more accurate to only count frames if that code has executed.
But then you're not doing anything with the count variable at the moment anyway, so its a moot point.
Since i added FPS, what is the lowest and highest FPS the eye can see?
I believe that 80 is perfect, because when i played sometimes in 60 it wasnt that nicely smooth.
Also, i learned that only with 4 lines of code the game becomes smoother
bool redraw = false;
redraw = true;
if(redraw){
redraw = false;}
And normally you need to put them in logic order because like this is a waste.
With the count variable, since it is put count++, i would be greatly amazed of not doing anything like you said, as it increments.
But normally, if you mean for the coordinates, i know it is a waste, but i had no time to delete the timer
I'm pretty sure the human eye's not supposed to be able to perceive more than 24 FPS or so...
I'm pretty sure the human eye's not supposed to be able to perceive more than 24 FPS or so...
I'm pretty sure that's bullshit.
Movies (and games?) have motion blur all over to look smoother.
Because I think someone is going to say, "But movies are played back at 24 fps and they look smooth!".
I mean a FPS about gaming, because even if human eye cannot perceive 1 FPS,
human brain can...
Alex-G: if the eye wasn't able to accept more than two frames per second, the brain wouldn't get more than two frames per second, thus the brain would not be able to process more than two frames per second, thus your statement is nonsensical.
taron: It would appear you're correct. I've got the chance to look it up, and (annoyingly) some sources say 10 FPS and others say hundreds. Some resources say it depends completely on the object being perceived, its motion and brightness. I.e. slow-moving fog doesn't need as many FPS as a fast-moving bullet.
Though, I found information that states Halo 3 is locked at 30 FPS. AFAIK that game looks relatively smooth.
If you see a frame(a photo) for each second, than the brain can perceive it.
(I mean you can calculate the box path if you know two movements of the box, but that said it is totally absolute, not relative)
It is just like in math, where if you find 2 points, you get the whole plane.
(You mean if you stand still the brain wont perceive you!)
I tried this program and compared 30 with 80 and it was a nice difference,
but i guess that 30 is quite normal
This is the flaw I see in using ALLEGRO_TIMER for logic: you can't max out FPS so you have to make sure that you use a high enough tick rate so that you don't notice anything.
The limiting factor isn't what the eye can see (24 FPS is indeed utter bollocks) but what the user's monitor can and will render. There's no use rendering at a higher frequency than the user's refresh rate.
This is a better version of the coordinates version without the counter and with a nice "player" name
I wanted to ask if anyone of you on this forum, has thought of creating a game together in a post, even thought it could sound silly...
So each member can add what he thinks is better like in github
The limiting factor isn't what the eye can see (24 FPS is indeed utter bollocks) but what the user's monitor can and will render. There's no use rendering at a higher frequency than the user's refresh rate.
^^^ That.
I wanted to ask if anyone of you on this forum, has thought of creating a game together in a post, even thought it could sound silly...
So each member can add what he thinks is better like in github
I think there has been several attempts to do such project here in Allegro. I found this one after searching for "project Monday". And I'm pretty sure I came across a project where everyone takes turn contributing exactly one line of code (or several), though I couldn't find it. I wonder what happened to that project..
Must see video... i accidentally found it!
http://www.youtube.com/watch?v=SoHeWgLvlXI&feature=related
gnolam: yeah, that sounds about right. I think I threw some factoids into a vat and smelted bullshit.