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

learn more… | top users | synonyms

4
votes
1answer
106 views

Multi-threading for rhythm game?

I'm trying to recreate a rhythm game. However trying to get the key-presses with SDL2 I ran into the problem, that you can only get an event every time a frame has been successfully rendered (I can't ...
1
vote
1answer
34 views

SDL2 SDL_PollEvent endless polling on key hold

What is wrong with SDL2 SDL_PollEvent() function? When I press-and-hold a key it enters "while (SDL_PollEvent())" block each frame. If in previous frame event queue was emptied and in new frame I ...
0
votes
0answers
10 views

How do I add EventTriggers to Multiple instantiated prefabs from a list?

I have a prefab which I am spawning a dynamic amount of. I want to attach an event trigger to each one of them, on pointerclick, to call a method accepting an int as parameter. I have the following ...
0
votes
2answers
64 views

Code Logic's execution with respect to time Events

I have to show complete 24 hours cycle in Unity3d Scene. Where different kind of task will be executed in different Times. Suppose at 2pm I have to move a car, at 6pm An Aeroplane will land on ...
7
votes
2answers
211 views

Good techniques for syncing gameplay actions to specific animation timings?

So I've come across an issue in the game I'm working on, but it seems to be a pretty fundamental thing that probably comes up in a lot of games. My game requires that some gameplay function occurs ...
2
votes
0answers
48 views

How can I model AI Interactions across the entire game world without computing them individually?

I'm making a 2D top-down tile-based game in C++ using SDL2. The game uses a very large world map (think Dwarf Fortress). My world terrain is generated using a noise function, another function is ...
0
votes
2answers
55 views

How to handle global Data within a state machine setup? (C#)

I am currently building a turn-based framework (Unity,C#) I was tired of my former tight-coupled systems and opted for a state machine this time, basically all components subscribe to the state-Enter ...
0
votes
0answers
20 views

Event handling for moving components in an HTML/JS game

I have developed a working prototype of an arkenoid-kind of game using plain HTML/JS/CSS3. I am using the DOM to display game elements. The whole game is infact contained inside a table element. Table ...
0
votes
0answers
43 views

How do I structure code that triggers story events at certain places?

I am planning to make a small game with a story that I have thought about for some time now. I am trying to decide how to handle stuff like if the character walks to this hitbox then a guy will come ...
18
votes
11answers
4k views

How do I ensure a piece of code runs only once?

I have some code that I only want to run once, even though the circumstances that trigger that code could happen multiple times. For example, when the user clicks the mouse, I want to click the thing:...
1
vote
1answer
85 views

SDL2 event mouse wheel trouble

it's been all day I have a problem getting mousewheel events properly in one of my program. I can make a program from scratch and it work properly, however as soon as i do the same things inside this ...
0
votes
0answers
76 views

How to make a PROPER main menu (or any other UI windows/modals) in Unity?

So, I'm currently learning both about Unity for the first time as well as the 'new' 2D UI system, but I'm having a hard time figuring out how to make windows, modals/dialogs, main menus etc. which are ...
1
vote
1answer
133 views

How to implement specific custom events in an Event Condition Action (ECA) game system?

A while ago I implemented a simple event-condition-action system for my game trying to emulate the Warcaft 3 trigger system (in a small scale, of course): So far, it works fine, but there is ...
0
votes
2answers
54 views

how to add an onclick event to a button?

If I will draw a button with canvas with any programming language (java,javascript....) I want to know how to add the events to what I've drawn for example If I will draw a button piture then what I ...
1
vote
2answers
4k 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
114 views

Unity/C# : How to execute a function after another function has finished its execution?

I've been trying to build a "event system" for a project that I'm working on . Here is how I'm doing it : I populate a list with reference to a gameObject and the functions that I need to execute from ...
1
vote
1answer
165 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 components....
0
votes
0answers
62 views

Multiple Event System in order to have a mainmenu and a submenu buttons selected

I'm developing a GUI at the moment for a game and I'm having problems making two buttons be selected at same time. I already looked around and the 2 work arounds I found was by extending the ...
1
vote
0answers
40 views

Unity: onEditEnd and onSubmit only firing from Return key

I have an InputField in my UI, but currently I can only submit its contents via the Return key. I tried mapping other buttons to the Submit action (e.g. the tab key on keyboard and the X button on my ...
4
votes
1answer
170 views

Event Handling in an ECS

I apologize if this has been answered already. I've looked around here, and read a few blog posts, but none seem to fully answer my question. I am writing an Entity Component System. Entity is a ...
2
votes
2answers
202 views

Reconciling external events with 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 ...
17
votes
3answers
8k 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 ...
0
votes
1answer
39 views

Competing keyboard events

When I was looking on how to handle key inputs in a game loop I came across the following pattern: All native key events (up or down) get queued in an event queue that is later processed. The outcome ...
1
vote
0answers
15 views

How to attach “exiting” event in OpenFL?

What is the exiting event (closing app by user or system) in new OpenFL? And how does it differs between target platforms?
0
votes
2answers
961 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 ...
2
votes
2answers
230 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 ...
1
vote
1answer
125 views

How do I know what button was clicked? (Unity)

I have a prefabbed button (UI.Button) which I'm instantiating ten times: public void LayoutButtons() { GameObject newCanvas = Instantiate (canvas) as GameObject; for (int i = 0; i < 10; ...
1
vote
1answer
229 views

Dynamic Events in an Entity Component System

My game makes extensive use of libGDX's Entity Component System Ashley, and my game world (including all levels and areas) is created with Tiled. In Tiled, I have an object layer where all of my ...
1
vote
0answers
741 views

Colliding without physics in Unity: is it possible to put OnTriggerEnter in the moving character?

My main question is: is it possible to put OnTriggerEnter in a script that goes attached to the moving character instead of to trigger area/object? Let me explain my exact need. I want to detect the ...
0
votes
0answers
75 views

Unity C# event handler not triggered

I am trying out a system in my game in which I have 3 classes: EventService: MonoBehavior EventStore (a normal c# class) EventViewController: MonoBehavior EventStore registers some callbacks to ...
0
votes
0answers
25 views

Performance slows down on click event

I'm currently working on a game in node using socket.io and drawing onto canvas. I'm noticing that when I click during the game, character movement slows to a crawl. For context: I'm updating x,y ...
1
vote
2answers
213 views

Unity 5 Dynamic Button Creation with Event Parameters

According to the documentation, you cannot instantiate buttons except via prefab instantiate. http://docs.unity3d.com/Manual/HOWTO-UICreateFromScripting.html You might wonder why we don’t have a ...
4
votes
1answer
198 views

Dialog/event system in Java/libGDX

I hope that I'm posting this correctly as I'm new to the site, feel free to correct me if I'm in the wrong spot. As for my issue: I'm working on an 2D side-scrolling platformer game in libGDX, and I'...
1
vote
1answer
173 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
0answers
149 views

Unity - How to detect collision on child object collider

How can we make to the event "OnTriggerEnter2D" collisions on the objects children of the object with the c# event script? Look this: Is there any way to assign the event using "Delegates"? ...
0
votes
1answer
168 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 vector<key&...
0
votes
0answers
32 views

Events Not Staying Attached in Unity 5

I'm successfully attaching a handler to an event, the event is firing, and somewhere in between then the event handler disappears. I don't know why, but I suspect it may have something to do with a ...
1
vote
0answers
44 views

How to synchronize events to clients?

I need to keep the client updated on data that's rarely changed (like health) or when an event occurs (like when a player is attacked and should have "-10 hp" above him). Those 2 specific part should ...
5
votes
4answers
4k 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 ...
1
vote
2answers
58 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 ...
8
votes
4answers
5k 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
137 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
301 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
1k 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
45 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
411 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
1k 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 ...
2
votes
1answer
164 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
292 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
119 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 ...