Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
24 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
17 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
1answer
130 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
23 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
63 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
111 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
149 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
878 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
79 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
116 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
109 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
494 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 ...
3
votes
1answer
116 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
223 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
119 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
219 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
273 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
480 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
191 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
153 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
956 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
94 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
108 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
515 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 ...
1
vote
1answer
799 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 ...
6
votes
2answers
302 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
765 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
2k 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
781 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
154 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
144 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
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 ...
0
votes
1answer
181 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() ...
4
votes
1answer
149 views

Game State and Configuration via Events

Often "singletons" are problematic for testing, so with my next game I'm trying my best to avoid them. But there is bunch of data (configuration or game state information) that different parts of my ...
3
votes
3answers
857 views

Unable to detect continuous keypress event in SDL

I am developing a game using SDL, and am unable to do continuous motion for my object when a key is held down. I'm calling SDL_PollEvent() to retrieve all events during a frame, and passing each ...
0
votes
2answers
292 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 ...
2
votes
3answers
1k views

Creating Rectangle-based buttons with OnClick events

As the title implies, I want a Button class with an OnClick event handler. It should fire off connected events when it is clicked. This is as far as I've made it: public class Button { public ...
3
votes
0answers
68 views

Check key state or listen for event? [duplicate]

Possible Duplicate: Polling vs event driven input I'm trying to teach myself a bit of game development using Pygame, and I'm unsure what's the best way to approach some of the fundamental ...
0
votes
1answer
515 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(){ }, ...
1
vote
0answers
86 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 ...
2
votes
1answer
336 views

Handling game logic events by behavior components

My question continues on topic discussed here I have tried implementing attribute/behavior design and here is a quick example demonstrating the issue. class HealthAttribute : public ActorAttribute { ...
-2
votes
1answer
162 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 [ ...
1
vote
2answers
284 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 ...
2
votes
1answer
87 views

How to apply effects that occur (or change) over time to characters in a game?

So assume that I have a system that applies Effects to Characters like so: public class Character { private Collection<Effect> _effects; public void AddEffect (Effect e) { ...
1
vote
2answers
301 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
2answers
287 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 ...
0
votes
1answer
170 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 ...
0
votes
1answer
193 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 ...
2
votes
2answers
643 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 ...