|
|
| Forum Search |
|
Showing Results 1 to 10 of 235 for collection of timer code. (Search Link)
New Search |
Previous |
Next
If a setup a timer to tick 1000 times a second, does it actually tick at this rate? Is it guaranteed to give 1000 ticks per second? Will the timer update more than one time per tick? Like in the code below, will tick_counter++ be 1000 before an update and 1020 afterward?[code]void updateTickCounter() { tick_counter++; } [/code]
Forum: Programming Questions
nonnus29 - 6 Replies - 08/16/2007 8:01 PM I'm making a start screen in wich you can choose from 3 options New Game, Load Game and Quit game by pressing up or down the problem is the keyboard input is collected way to fast. Is there any thing I can do against this?Here's part of the code [code] // looping // check for input // key up if(key[KEY_UP]){ // New game is selected if (select_start == 0){ select_start = 2;} // otherwise else { select_start--;} } // key down if(key[KEY_DOWN]){ // Quit game is selected if (select_start == 2){ select_start = 0;} // otherwise else{ select_start ++;} ...
Forum: Programming Questions
Sylvarant - 2 Replies - 11/14/2006 2:10 PM Hi!I have a problem with my game loop, or the event handling. The loop or allegro seems to miss out on certain events, which is mostly notices on keyboard (up/down) events.I have created a class for the keyboard, that stores key presses (key[true|false]) to enable IsKeyPressed(int key), for i.e. move player on screen, and such.The problem though - although not every time - is that when I press for example UP and LEFT at the same time, either LEFT or UP does not receive the KEY_UP state when I release one of them, thus making the character move in that direction until I press it again to ...
Forum: Programming Questions
Øyvind Andersson - 2 Replies - 01/04/2013 11:00 AM Running through some tutorials and I'm wondering if a single event queue can have multiple sources? Can I store events from the keyboard and the display in the same event queue?
Forum: Programming Questions
Otto Borden - 11 Replies - 06/20/2010 12:53 PM I read in the wiki that it's OK to have multiple event queues but is there any down side to having a bunch of these? I'm looking at making a Timer class to abstract timers, and to make them 100% independent from each other I was thinking of giving them their own event queue. Is this going to cause any issues if I have 20 event queues laying around?
Forum: Programming Questions
RickyLee - 15 Replies - 12/09/2012 1:36 PM I need source codes for small(very small or just example type) games.Where can I get It?also Why cant I compile this source?http://www.cppgameprogramming.com/Images/SpaceFight/SpaceFight.zip
Forum: Programming Questions
Coldforge - 7 Replies - 01/19/2009 7:46 AM This is probably a weird forum to post in but I thought maybe you guys were friendlier than the ones at xtremevbtalk.com ... Its to do with game programming so I qualify to stay here Anyway with my game. Im not sure how to do object handling. Someone told me to do 'Collections' but didnt get too 'on the topic'. Anyone know how I could do object handling and that when an object (class) is created that itd be able to run a particular method (called Step) ?
Forum: Off-Topic Ordeals
Archon - 12 Replies - 05/15/2004 5:22 PM When I started using Allegro, I was in a rush to finish a college project with it, hence my study time was low. Originally, I just used the clock() method of somewhat governing my game. For ChristmasHack, I decided to use/learn the allegro methods.After a little messing around and reading other discussions about timers (there's quite a bit if you do a forum search), I've got a basic understanding. I thought I'd present my methodology and see what the general consensus is, pros and cons.Without further ado,My timer function is very simple:[code] volatile int system_timer; void ...
Forum: Game Design & Concepts
Onewing - 26 Replies - 12/19/2005 3:50 PM Hello to everybody I'm rather new in programming with allegro using DJGPP. I've encountered a little problem which have forced me to convert my C++ programs into C in order to be able to use allegro timers but I would like to be able to switch again to C++. In C the usual code is : volatile int counter = 0; void my_callback_func(){ counter++;} END_OF_FUNCTION (my_callback_func); which is after following in the main fonction by the locking of the int and fonction : LOCK_FUNCTION (my_callback_func); LOCK_VARIABLE (counter); In C++, locking the function create the error in compilation ...
Forum: Programming Questions
Alexis FREY - 8 Replies - 10/29/2004 12:55 PM I tested a game sketch with a powerful PC, and it was completly unplayeable because it rans too fast!.1-How can force the game to run no more than 60fps? 2-Installing more than one timer will slow the program too much?
Forum: Programming Questions
lucaz - 68 Replies - 01/17/2005 2:10 PM New Search |
Previous |
Next
|