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

learn more… | top users | synonyms

0
votes
2answers
64 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
69 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
58 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
56 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
30 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
40 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 ...
0
votes
0answers
20 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
59 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
0answers
60 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
224 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 ...
0
votes
1answer
76 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 ...
1
vote
1answer
127 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 ...
1
vote
1answer
130 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
253 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 ...
0
votes
1answer
138 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 ...
2
votes
1answer
93 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
101 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
153 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
107 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
41 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 ...
2
votes
2answers
516 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
34 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
98 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 ...
2
votes
1answer
300 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
167 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
995 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
196 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
201 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?
0
votes
2answers
121 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 ...
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 ...
4
votes
1answer
162 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
564 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 ...
1
vote
1answer
123 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 ...
2
votes
1answer
288 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 ...
0
votes
1answer
430 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. ...
3
votes
1answer
860 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
218 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
1answer
203 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 ...
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 ...
-1
votes
1answer
108 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
117 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 ...
2
votes
1answer
719 views

LibGDX Scene2D event handling and bounding box relative to the center of a TextureRegion

I'm experimenting with Scene2D to see if it fits fot the game I want to develop. Say I have an Actor with the origin in the center of its TextureRegion. My setup method contains this code: float ...
2
votes
1answer
1k 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 ...
7
votes
2answers
323 views

Where to put Entity Death Events in a Component/System Design

Entities in my game are nothing more than a collection of components, tied together with an entityID. I have (near) data-only components, and systems that work on the data. One of these components is ...
4
votes
2answers
1k views

How to implement an event system

Im trying to implement an Event System for a game, where there are classes that can fire or handle an event wheter or not they implement these interfaces: public interface IGameEvent<T> where T ...
5
votes
3answers
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 ...
3
votes
3answers
1k views

Effective way to check if an Entity/Player enters a region/trigger

I was wondering how multiplayer games detect if you enter a special region. Let's assume there is a huge map that is so big that simply checking it would become a huge performance issue. I've seen ...
4
votes
1answer
164 views

Time critical events based on framerate

Problem Description Basically, I've made a "programming game" in which I've made my own scripting language. It is a completely standard Lunar Lander game, though instead of directly controlling the ...
-1
votes
2answers
195 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")){ ...