Event is action that is usually happenes "outside" of main program thread, but handled inside of it.

learn more… | top users | synonyms

2
votes
2answers
668 views

pointers to member functions in an event dispatcher

For the past few days I've been trying to come up with a robust event handling system for the game (using a component based entity system, C++, OpenGL) I've been toying with. class EventDispatcher { ...
1
vote
1answer
1k views

Using Event Driven Programming in games, when is it beneficial?

I am doing a refresher on ActionScript 3. Other than using rudimentary tools like, Event.ENTER_FRAME and using events to receive input from the user's mouse and keyboard, I find that I rarely use ...
2
votes
2answers
130 views

How do I drag my widgets without dragging other widgets?

I have a bunch of drag-able widgets on screen. When I am dragging one of the widgets around, if I drag the mouse over another widget, that widget then gets "snagged" and is also dragged around. ...
6
votes
4answers
813 views

Game Clock Precision

I'm reading a fantastic article about game timer precision and here is a quote about 2/3 of the way into the article: If you start your game clock at about 4 billion (more precisely 2^32, or any ...
1
vote
0answers
490 views

Corona sdk events dispatched with dispatchEvent() are handled directly upon call. Why so? [closed]

I noticed to my surprise that an event created with dispatchEvent(event) gets handled directly when called, and not together with other events at a specific phase of the frame loop. Two main reasons ...
1
vote
4answers
2k views

SDL - Getting a single keypress event instead of a keystate?

Right now I'm working on a simple SDL project, but I've hit an issue when trying to get a single keypress event to skip past a splash screen. Right now, there are 4 start-up splash screens that I ...
1
vote
1answer
617 views

User input in game loop

I am building a simple multi-player fly-around-a-3D-world game in Javascript/webGL/websocket (Chrome, Firefox mostly). How should I handle and process user input? My preliminary design (untested) is ...
2
votes
2answers
475 views

Simulating probability

Stupid stupid question but here we are.. so, I want to generate some random events for an iPhone game but I guess this could be applied to any game written with a framework that suppports calls to ...
4
votes
5answers
1k views

Should my game handle collisions in the Player object?

I'm making a 2D platform game. Right now I'm just working on making a very generic Player class. I'm wondering if it would be more efficient/better practice to have an ActionListener within the Player ...
1
vote
3answers
1k views

Efficiently checking input and firing events

I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events: internal ...
-1
votes
1answer
702 views

Windows Events lag behind

I'm making a simple openGL application and so far I can get the window to display, the update/render loop work, and it processes windows events (like WM_QUIT and WM_MOUSE). I've found though that ...
0
votes
1answer
216 views

Implementing a Turn-Based Game with Windows API Window Messages

I'm trying to make a 2-player Connect 4 game, but I'm having trouble wrapping my head around some of the concepts related to incorporating event handlers while progressing with the game. On the one ...
1
vote
1answer
276 views

Unit selection - logic & screen communication

I'm building a game using SFML, with disconnected logic & screen systems that run on different threads and communicate through synchronised buffers. Now, this system worked perfectly well when I ...
0
votes
1answer
962 views

SDL mouse wheel not picking up

Running Ubuntu 11.04, SDL 1.2 trying to pickup mouse wheel up/down movement with this (stripped down) code: int main( int argc, char **argv ) { SDL_MouseButtonEvent *mousebutton = NULL; ...
1
vote
0answers
367 views

In a state machine, is it a good idea to separate states and transitions? [closed]

I have implemented a small state machine in this way (in pseudo code): class Input {} class KeyInput inherits Input { public : enum { Key_A, Key_B, ..., } } class GUIInput inherits Input { ...
7
votes
2answers
559 views

Handling commands or events that wait for an action to be completed afterwards

Say you have two events: Action1 and Action2. When you receive Action1, you want to store some arbitrary data to be used the next time Action2 rolls around. Optimally, Action1 is normally a command ...
1
vote
0answers
165 views

Farseer Physics EndContact events don't fire for all registered delegates

Here's my situation: I have several objects that contain a body and a fixture. They are set to sensor = true; atmosphere = BodyFactory.CreateCircle(world, atmosphereRadius / Level.METER_IN_PIXELS, ...
0
votes
3answers
209 views

A question regarding how to respond to 'events'

What is the best practice to use when events happen in a game? For example: You have a sensor. When a particular game actor is near that sensor, a sound must be played and a door must be closed. ...
0
votes
2answers
568 views

Is it possible to generate Events and Hooks in Lua for any game without built-in support?

Does a game have to have built-in functions to accept and run lua scripts, or can I design Events and Hooks using Lua on any game I please, akin to the days where C code could be used to hook into the ...
2
votes
1answer
126 views

Any problems with Event usages within XNA on Xbox/Phone

This is a slightly vague one but I am currently looking at a couple of areas of my current framework, such as spatial partitioning and UI based menus, and with UI menus it makes sense to have an event ...
1
vote
4answers
885 views

How do I respond to keyboard events which occur between polling?

In my games update loop, which happens on a fixed timestep of 30 times per second, I am checking the current state of several keys to determine how to move the player. For example: ...
1
vote
1answer
142 views

How can I throttle certain player actions?

Background I have a variable time step, component based game, with components that collectively hold an entity's properties and different systems that act on entities with certain required ...
6
votes
2answers
291 views

Which code module should map physical keys to abstract keys?

How do you bridge the gap between the library's low-level event system and your engine's high-level event system? (I'm not necessarily talking about key events, but also about quit events.) At the ...
-2
votes
2answers
137 views

Should collision sounds and UI responses be deferred or processed immediately?

When checking for collisions between entities, should you play a collision sound immediately on discovering a collision or queue every collision and process the sounds later? Similarly for user user ...
9
votes
4answers
2k views

What technique should I use to facilitate communication between XNA GameComponents (or between components of any type in a game)?

I'm starting out on my first 'proper' game project, and I've inevitably hit a block trying to decide how game components in XNA should communicate. From previous (Java) GUI programming events, ...
9
votes
3answers
1k views

What should I be considering when designing an Event Manager System?

I have been puttering around with the fundamentals of a Java game engine, and I've reached the point where I'm ready to add in an Event Manager system. I know, in theory, what an Event Manager should ...
8
votes
3answers
2k views

Better Way To Set Up an Event System

Event Systems are amazing, they make extremely unwieldy code tame and really allow for dynamic creation of games through easy communication of objects and the game loop. I am having a hard time with ...
1
vote
3answers
841 views

create an event for every enum value (game action handeling)

I'm currently working on creating an input-action system for my game. I simply wanted an easy way to map an ingame action to a certain key. I've managed to do so with the following method: Create a ...
7
votes
3answers
457 views

Events, Posting vs Queuing

I'm implementing a messaging system and I'm wondering about how I should handle events. Should I post them and send them to the appropriate listeners as soon as I receive them, or should I queue them ...
13
votes
3answers
1k views

Avoiding singleton pattern for Event Scheduler?

I want to make an Event scheduler for my Game, I basically want to be able to schedule the triggering of a Game Event. This can be a one time trigger, or a periodic trigger (trigger event ...
9
votes
3answers
1k views

Best way to manage in-game events?

I'm working on a game where some in-game events need to happen once in a while. A nice example would be a tutorial. You start the game, and at several points in the game an event occurs: You ...
8
votes
4answers
4k views

Should I use Events in a XNA Game?

I created a button class which draw a button on the screen. When I click on it, I want to see something happening. In WinForm, I would simply use the event OnClick of the button. What about XNA? ...
10
votes
5answers
826 views

Nested input in an event-driven system

I am using an event-based input handling system with events and delegates. An example: InputHander.AddEvent(Keys.LeftArrow, player.MoveLeft); //Very simplified code However, I started wondering ...
3
votes
1answer
740 views

Flash AS3 Tower Defense MouseEvents

In my tower defense game and every tile has its own mouse event listener. I am wondering, would it be better to use one event listener (MouseEvent.CLICK) and then when it runs the function, should I ...
5
votes
4answers
715 views

Browser-board-game and server push

I want to start developing a browser game. Not for success, just for the sake of doing it and learning something from it. Now, a point where I have serious problems figuring out how to deal with it ...
1
vote
2answers
821 views

Flash Custom Events

I am working on a Flash Tower Defense game. I have a main game loop which is an eventListener for each frame. Whenever you gain money or lose a life, I want the GameUI to be updated to display this ...
17
votes
3answers
5k views

Polling vs event driven input

I'm developing a game using polling for the input method. However, now that I'm delving deeper into the game menus and other UI components, I'm finding that I'd probably like to have event driven ...
1
vote
2answers
508 views

Problems with Creating Snake's Clone on Java

I'm creating Snake's clone. My app have too classes: Snake.java and Board.java. Right now I have three problems: 1) There are two constants - BOARDS_WIDTH, BOARDS_HEIGHT. They are meant to be ...
4
votes
2answers
686 views

How should I manage events in XNA on the Windows Phone 7 without impacting performance?

It's best-practice to not to create lots of short-lived temporary objects the heap as it'll eventually force a garbage collection during game-play. It is best to create short lived value objects. ...
-3
votes
2answers
112 views

Are there companies that can store the stream of each user event? [closed]

I want a company that can store in a database of it's own the stream of clicks each user does (my game is programmed in action script), of course I will define what data and when to store it. Bear in ...
4
votes
4answers
766 views

Level editor event system, how to translate event to game action

I've been busy trying to create a level editor for a tile based game i'm working on. It's all going pretty fine, the only thing i'm having trouble with is creating a simple event system. Let's say ...
2
votes
4answers
1k views

Flash framerate reliability

I am working in Flash and a few things have been brought to my attention. Below is some code I have some questions on: addEventListener(Event.ENTER_FRAME, function(e:Event):void { if (KEY_RIGHT) ...
4
votes
4answers
2k views

One True Event Loop

Simple programs that collect data from only one system need only one (blocking) event loop. For example, Windows applications have the message loop, POSIX network programs usually have a ...
7
votes
4answers
4k views

Per-Frame Function Calls versus Event Driven Messaging in Game Design

The traditional game design, as I know it, uses polymorphism and virtual functions to update game objects states. In other words, the same set of virtual functions are called in regular(ex: per-frame) ...
43
votes
8answers
11k views

Event-driven Communication in a Game Engine: Yes or No?

I am reading Game Coding Complete and the author recommends Event Driven communication among game objects and modules. Basically, all living game actors should communicate with the key modules ...
3
votes
4answers
4k views

Multiple Key Presses in XNA?

I'm actually trying to do something fairly simple. I cannot get multiple key presses to work in XNA. I've tried the following pieces of code. else if (keyboardState.IsKeyDown(Keys.Down) && ...
10
votes
3answers
2k views

Algorithm for determining random events

I'm struggling with coming up with an elegant solution to generating random events in the game that I'm working on. Say there are 4 classes of events that can happen, with varying events in those ...
18
votes
3answers
784 views

Do I, and how, separate the concerns of input and game objects?

In probably every game a developer has to somehow deal with input, may it be simple keyboard and mouse events, touch events or something as accelerometer input. This input directly of indirectly ...
12
votes
4answers
980 views

Game log format for MMO servers

A log of game events (as opposed to error / debug logs) for an entire cluster/shard is very useful for a commercial MMO that is in a live production environment, providing vital support for customer ...
11
votes
5answers
4k views

Keyboard input system handling

Note: I have to poll, rather than do callbacks because of API limitations (SFML). I also apologize for the lack of a 'decent' title. I think I have two questions here; how to register the input I'm ...