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

learn more… | top users | synonyms

5
votes
4answers
3k views

Game loop on windows

I have seen different "basic" game loops both from books like "Introduction to 3D game programming with DX11" or online tutorial ( Rastertek ) and if we take off all the fancy stuff to control ...
0
votes
1answer
48 views

Missing keyup event

I have a pretty generic input class. In the main app, I forward an event to the game. The game an input object that manages Keyup and Keydown presses. It stores the keys pressed in a ...
1
vote
1answer
99 views

Programming game logic outside the game loop

Is there any way I can program (in Java or Python, but open to other solutions) some game logic based on events, timed and sent by player input, without dealing with it inside the game loop, by having ...
1
vote
1answer
141 views

Event handling on own UI implementation in XNA

I´m creating a game in XNA with my own UI and its controls/components. Currently I have some problems with the event handling. Let me tell me the way I do it right now. Every object is handles as a ...
0
votes
1answer
293 views

How to change the speed of the gameobject moving on the itween path

I have set an itween path for an object to move.And I have written the code as iTween.MoveTo(gameObject,iTween.Hash ("path",iTweenPath.GetPath("train"),"time",300)); The above code is working for ...
1
vote
2answers
49 views

Runtime Error dealing with SDL_Events

I do not know if this is the best way to handle these SDL_Events, but I am attempting to create a very abstract and generic code that will update my Game Object. Basicly I have a Scene which in my ...
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) ...
0
votes
2answers
85 views

How to design parameters for events

I'm working on the event system for my engine, and have some trouble deciding what types of parameters my events should have to be both generic and specific at the same time. I want to be able to ...
1
vote
1answer
67 views

Event-/Input system with SFML: Cannot move diagonally in 2D

I am a beginner in anything with game development. I written a small prototype in which i can move a square around with the arrow keys. For that i use SFML. At the moment i experiment around with my ...
0
votes
2answers
105 views

How do I trigger OnSelect() via the ISelectHandler in my class?

I'm trying to figure out how I can make a custom UI element identify when it has been selected or deselected. Classes such as Selectable inherit from the ISelectHandler and IDeselectHandler and their ...
0
votes
0answers
43 views

Unity Input manager with chain of responsibility and delegates

I am working with unity and I am trying to build a better input system for my game. In essence there would be a singleton class that is the input manager. The player would subscribe to the manager ...
0
votes
0answers
39 views

How to load in movable (full) models?

I've created a rendering engine in Haskell, and I've got an OBJ model loader. Obviously, the models I've loaded in a complete set of vertices, normals and texture coordinates for the model. But say, ...
1
vote
0answers
54 views

How do I manually submit a new UI InputField in code?

I need some conditions for submitting the text inside of an Inputfield, however I cannot find a way to do this via code. I was expecting something simple like with WPF or WinForms, but I cannot find ...
2
votes
2answers
559 views

Event Driven Behavior Tree: deterministic traversal order with parallel

I've studied several articles and listen some talks about behavior trees (mostly the resources available on AIGameDev by Alex J. Champandard). I'm particularly interested on event driven behavior ...
0
votes
0answers
24 views

Change pointerDrag target during a drag

In Unity, I am trying to change which GameObject is receiving drag messages from my EventSystem's StandaloneTouchInputModule. E.g., while I'm dragging one object, a script reassigns who is receiving ...
2
votes
1answer
64 views

Is OnMouseUp()'s behavior intended?

Version: Unity3D 4.6.2f1 I have a grid of tiles (Cube GameObjects with a Tile script attached). They are positioned at their index location [x][y] = (x, y, z=0) World Coordinates. Below, I try to ...
0
votes
1answer
149 views

How to check a value from the last frame, while using events in Unity

What I am trying to do is check if a value has changed from the last frame, while using events. Typically I could use threading to my advantage and have a check at the bottom of Update() to see if a ...
0
votes
0answers
71 views

How to make touch events work in a match three type game

In "match three" types of games like Crazy Kitchen, when the user touches an image, he can drag his finger over multiple images and create a change in each image he touches in a single gesture. You ...
0
votes
1answer
80 views

How to deal with events in a game with multiple players, in Unity?

As I'm developing our game I have asked myself a couple times "When we have more than 1 player, how will I ensure events from player A do not crossover to player B?" As an example, lets say player A ...
2
votes
1answer
2k 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 ...
4
votes
6answers
2k 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
1answer
148 views

Responding to mouse input on game objects

I'm trying to make a simple button in unity using a cube. My plan is for when the cube is highlighted that it will move towards the camera and be highlighted in a specific color and then when it is ...
3
votes
2answers
276 views

How can you subscribe to Unity input events, instead of polling for them

Been trying for days to figure out if there is a way to subscribe to keyboard/mouse events in unity. Instead of having to poll for them every frame and make my own events. Right now I poll through ...
2
votes
1answer
100 views

Event error: “…can only be called from the main thread”

I have some custom networking classes which I'm trying to use in a unity game (c#). The network class raises events, which I want to subscribe to in the game code. However, whenever I try to do ...
0
votes
1answer
109 views

Event handling for Pressing only 4 keys on desktop

I want to poll only 4 keys i.e. Keys.LEFT, Keys.RIGHT, Keys.Up and Keys.Down in libGDX strictly. That means, I want to call render method, only when above 4 keys are pressed. I followed below link ...
1
vote
1answer
182 views

Andengine onAreaTouched TouchEvent not working - ACTION_OUTSIDE & ACTION_CANCEL

I have a simple problem. I have a button on the screen. I want isActionDown to push the button down, and isActionUp to push the button back up again and make my character jump. But the problem is if I ...
0
votes
0answers
127 views

(libgdx) how to make an actor transmits the events it receives to its children?

I use the following class : public class InGameMenu extends Actor{ /** VARIABLES **/ private boolean debug= true; private float x,y,width,height, margin; private static final String TAG = ...
0
votes
0answers
46 views

SharpDX: listen to SizeChanged

I am using SharpDX and the SharpDX.Toolkit.Gameclass within a WPF-Application. The SharpDX stuff is hosted within a SharpDXElementcontrol, like this: var element = new SharpDXElement ...
0
votes
1answer
102 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 ...
12
votes
4answers
1k 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 ...
2
votes
2answers
1k views

Adding touch/click event to a bitmap in android

In my android game, there is a surfaceview which has 36 bitmaps drawn on it. I want to change the bitmaps when they are touched. Is there a way implement touch or click event to the bitmaps ? Adding ...
0
votes
1answer
2k 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
0answers
36 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&){ ...
2
votes
1answer
338 views

How to subscribe to an event fired from any Instance/Object of type X

I'm currently working on a small game-engine and i'm kinda stuck on finding the right pattern to subscribe to an event fired from any instance of type X.To understand what i'm trying to achieve, here ...
0
votes
2answers
169 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 ...
8
votes
5answers
1k views

Turning a board game idea into a browser based, slow paced gameplay

Suppose I want to create a strategy game with global mutable state shared between all players (think game board). But unlike a board game, I don't want it to be real time action and/or turn-based. ...
-1
votes
1answer
202 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 ...
1
vote
1answer
212 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?
-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 ...
0
votes
2answers
123 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 ...
46
votes
8answers
13k 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 ...
0
votes
1answer
462 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. ...
-1
votes
1answer
998 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 ...
4
votes
1answer
168 views

EventManager adding data to the event message

Some backstory: I decided it was time to start making a game. I've got a bachelor degree in computer sciences, but I didn't really get to code much during my studies. I've started making a quick ...
2
votes
1answer
609 views

When one should use events in Unity and how they impact performance?

let's say that inside an OnGUI() script we want to call a method from another script to handle a particular situation. From a prestational point of view, what's the difference between these 3 ...
2
votes
1answer
299 views

Why game loop should be running on a separate thread?

I am struggling to fully understand the responsiveness argument suggesting to run the game loop on a separate thread other than main thread. When OS sends a user event (touch, mouse move, etc.) it ...
1
vote
1answer
124 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 ...
3
votes
1answer
894 views

How can I detect mouse events on sprites in a canvas?

I'm making an HTML 5 game. I want mouse clicks on sprites drawn in a canvas element cause events that my code can react to. At the moment, I'm doing it by checking through all of my sprites in a ...
0
votes
2answers
221 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 ...
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 ...