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

learn more… | top users | synonyms

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
2answers
268 views

what is the best way to use loops to detect events while the main loop is running?

I am making an "game" that has pathfinding using pygame. I am using Astar algo. I have a main loop which draws the whole map. In the loop I check for events. If user press "enter" or "space", random ...
1
vote
4answers
813 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
2answers
231 views

Coding Dynamic Events?

I have no idea what the title of this question should be so bare with me. My game has turns. On a turn a player does something and this can result in a random number of explosions that occur at ...
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
vote
3answers
2k views

How to create / draw clickable object (such as Button in WinForm) in XNA WP8?

I am developing a 2D (No 3D in every aspect) Windows Phone 8 turn based tactical games for my college project. I use Monogame. I want to draw an object similar to Button in windows form, that if the ...
1
vote
1answer
141 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 ...
1
vote
3answers
804 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 ...
1
vote
2answers
493 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 ...
1
vote
1answer
87 views

How can I play an animation in response to an event?

I've written a script to play an animation, but it starts immediately as my level loads. Instead, I want it only to start when triggered by some event or after a given timeout. How can I do this?
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 ...
1
vote
1answer
259 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 ...
1
vote
2answers
763 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 ...
1
vote
1answer
111 views

How do I best solve multiple component modifications via a single event?

I'm trying to solve multiple component modifications via a single event. Is there a better way of handling this? I have an a label entity that cares about when a shield entity's hitpoints component ...
1
vote
1answer
134 views

Is the Key Bindings delay unavoidable in Java when pressing different directional keys quickly?

I've read just about every tutorial I can on why to use Key Bindings instead of implementing the KeyListener interface, including all the examples that show using a field to track the key event ...
1
vote
2answers
277 views

Events Driven Library XNA C#

Language: C# w/ XNA Framework Relevant and Hopefully Helpful Background Info: I am making a library using the XNA framework for games I make with XNA. The Library has a folder(Namespace) dedication ...
1
vote
1answer
576 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 ...
1
vote
0answers
84 views

Collision detection code style [closed]

Not only there are two useful broad-phase algorithms and a lot of useful narrowphase algorithms, there are also multiple code styles. Arrays vs. calling Make an array of broadphase checks, then ...
1
vote
0answers
442 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
0answers
351 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 { ...
1
vote
0answers
163 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
1answer
209 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 ...
0
votes
1answer
829 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; ...
0
votes
2answers
522 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 ...
0
votes
2answers
99 views

How can I efficiently update only the entities that matter in a given frame?

I'm making a RTS, which can potentially have lots of units in one map (think Age of Empires). I'm looking for a way to update my units. I want to avoid calling a virtual Update() method every frame ...
0
votes
2answers
100 views

How to design reward and points system?

There are few events in my game, like complete levels , complete puzzles , kill enemies and so on. Each such event will reward the player points and bonus powers. Now each "master" task (for example ...
0
votes
1answer
438 views

Am I doing this node.js game loop wrong?

I have 2 arrays of JSON objects, actions and game objects. At any time a user can make a request from the client which can add an action to the actions array. I have a setInterval(function(){ }, ...
0
votes
1answer
49 views

AS3 eventListener not working [closed]

I am making a game with as3. I have a Mian Class.In its main function i am putting a movieClip stored in a variable named btn and attaching an EventListener to it for CLICK which envokes a function ...
0
votes
1answer
176 views

Why does this code to filter events with SDL not function properly?

According to the SDL2 wiki, SDL_SetEventFilter : Use this function to set up a filter to process all events before they change internal state and are posted to the internal event queue. ...
0
votes
2answers
169 views

How can I regulate update and event frequency?

I'm trying to create a small 2D RPG-type engine using C++, SDL/OpenGL and Tiled. My little demo looks very similar to a Pokemon or Zelda game. I was curious how to go about regulating FPS and how ...
0
votes
1answer
570 views

Keyboard and Mouse callbacks in GLUT

I'm using OpenGL via GLUT in Ubuntu. While writing text in a text editor, the first keystroke is printed immediately. But if we keep pressing the key, it waits for a moment and then prints a trail of ...
0
votes
1answer
157 views

Problem with Widget Event Reporting in Libgdx

So I'm trying to test an ImageButton on an Android device. I can get the button to appear on the screen, but when I press it nothing happens or appears on the log. Here is what I have in the Show() ...
0
votes
1answer
180 views

Building a touch event driven UI from scratch: what algorithms or data types? [closed]

I have a touch display. As input I can receive the coordinates and how many touch points are in use, basically I just get an X,Y couple for every touch event/activated point at a customizable rate. I ...
0
votes
3answers
208 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
0answers
20 views

changing camera's reference point position by a keyboard event

I would like to change the camera's reference point position using gluLookAt. I would like that it changes when I press for exemle 'a'. I tried with: void VueOpenGL::Paint(wxPaintEvent&){ ...
0
votes
1answer
26 views

Server Side : How to manage “delay” action/event like attacking?

at the moment I'm writing a game server, so I made an event "handler". I mean, if a player send to the server "I move" it fire a function, so I think I'm doing well at the moment. But there's a ...
0
votes
1answer
489 views

Input events slow on unity Update function

I have this running on the Update() on Unity. I am trying to create a page swipe feature on my game, but the problem is there is a half second delay when printing "dragging" to "end drag" when I ...
0
votes
2answers
251 views

Best approach for Event driven UI

Had an idea for a modification to a game, however the core functionality heavily involves UI, and the API for the mod is event based. The player will have there own custom data object, so I know one ...
0
votes
1answer
167 views

Creating a newspaper that effects the game's economy?

I am writing a game in Objective C/cocos2d where a newspaper is a central part of what controls or rather effects the game's world economy as well as what a city might do (such as increase X, reduce ...
-1
votes
1answer
99 views

Advice on developing a random event engine [closed]

I am looking into creating a random event engine like the one found in the Paradox Interactive’s Europa Universalis franchise. They use a ‘mean time to happen’ mechanic that applies various ...
-1
votes
2answers
128 views

UnityScript generating UnityEngine error

I have the following code set out for a simple animation in Unity: #pragma strict function Start () { } function Update () { if (Input.GetButtonDown("KeyCode.W")){ ...
-1
votes
1answer
85 views

A custom method for events [closed]

Basically what I am trying to do here is to create an event system for a simple game engine I am working on. I'm trying to make this program as platform independent as possible with the C++ language ...
-1
votes
1answer
516 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 ...
-2
votes
1answer
161 views

How do I set an event off when player is on certain tile?

Here is the code I use to create and print my map to the canvas: var board = []; function loadMap(map) { if (map == 1) { return [ ...
-2
votes
2answers
135 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 ...
-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 ...