Event is action that is usually happenes "outside" of main program thread, but handled inside of it.
2
votes
1answer
84 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
68 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")){
...
0
votes
0answers
24 views
How to read (and discard) Windows events in Ogre?
In my Ogre application I use a custom mouse handler implementation instead of OIS (to support more than one mouse). That is working fine, however, without OIS when reading mouse events directly they ...
1
vote
3answers
64 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
25 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() ...
3
votes
4answers
2k views
Multiple Key Presses in XNA?
I'm actually trying to do something fairly simple.
I cannot get multiple key presses to work in XNA. I've tried the following pieces of code.
else if (keyboardState.IsKeyDown(Keys.Down) && ...
4
votes
1answer
99 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
229 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
135 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
0answers
71 views
Using boost function to wrap execution of a boost signals2 signal
I am considering using the boost library to design a simple yet effective callback event notification framework for my game application. The idea is that objects that can raise events would have a ...
2
votes
2answers
268 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
61 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 ...
7
votes
2answers
412 views
Handling commands or events that wait for an action to be completed afterwards
Say you have two events: Action1 and Action2. When you receive Action1, you want to store some arbitrary data to be used the next time Action2 rolls around. Optimally, Action1 is normally a command ...
0
votes
0answers
211 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(){ }, ...
-2
votes
1answer
153 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
0answers
77 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
204 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
{
...
1
vote
2answers
219 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
70 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
212 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
2answers
157 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 ...
0
votes
1answer
144 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
130 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
0answers
85 views
How are events in games handled? [duplicate]
Possible Duplicate:
Best way to manage in-game events?
In may games that I have played, I have seen events being triggered, such as when you walk into a certain land area while holding a ...
2
votes
2answers
286 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 {
...
6
votes
4answers
624 views
Game Clock Precision
I'm reading a fantastic article about game timer precision and here is a quote about 2/3 of the way into the article:
If you start your game clock at about 4 billion (more precisely 2^32,
or any ...
1
vote
1answer
466 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 ...
2
votes
2answers
101 views
How do I drag my widgets without dragging other widgets?
I have a bunch of drag-able widgets on screen. When I am dragging one of the widgets around, if I drag the mouse over another widget, that widget then gets "snagged" and is also dragged around.
...
1
vote
0answers
211 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
4answers
738 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 ...
10
votes
5answers
2k views
Keyboard input system handling
Note: I have to poll, rather than do callbacks because of API limitations (SFML). I also apologize for the lack of a 'decent' title.
I think I have two questions here; how to register the input I'm ...
1
vote
2answers
424 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
410 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 ...
4
votes
5answers
693 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 ...
2
votes
2answers
274 views
Simulating probability
Stupid stupid question but here we are..
so, I want to generate some random events for an iPhone game but I guess this could be applied to any game written with a framework that suppports calls to ...
2
votes
0answers
257 views
Creating a level editor event system
I'm designing a level editor for game, and I'm trying to create sort of an 'event' system so I can chain together things. If anyone has used RPG Maker, I'm trying to do similar to their system. Right ...
1
vote
2answers
581 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 ...
0
votes
2answers
318 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
0answers
255 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 ...
0
votes
1answer
176 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 ...
1
vote
0answers
140 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, ...
1
vote
1answer
205 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 ...
9
votes
4answers
1k views
What technique should I use to facilitate communication between XNA GameComponents (or between components of any type in a game)?
I'm starting out on my first 'proper' game project, and I've inevitably hit a block trying to decide how game components in XNA should communicate.
From previous (Java) GUI programming events, ...
0
votes
1answer
440 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;
...
1
vote
0answers
285 views
In a state machine, is it a good idea to separate states and transitions?
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
{ ...
6
votes
2answers
272 views
Which code module should map physical keys to abstract keys?
How do you bridge the gap between the library's low-level event system and your engine's high-level event system? (I'm not necessarily talking about key events, but also about quit events.)
At the ...
37
votes
8answers
6k views
Event Driven Communication in Game Engine - Yes or No?
As I am reading book Game Coding Complete (http://www.amazon.com/Game-Coding-Complete-Third-McShaffry/dp/1584506806/ref=sr_1_1?ie=UTF8&qid=1295978774&sr=8-1), the author recommend Event Driven ...
0
votes
3answers
186 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.
...
5
votes
4answers
602 views
Browser-board-game and server push
I want to start developing a browser game. Not for success, just for the sake of doing it and learning something from it.
Now, a point where I have serious problems figuring out how to deal with it ...
8
votes
3answers
665 views
What should I be considering when designing an Event Manager System?
I have been puttering around with the fundamentals of a Java game engine, and I've reached the point where I'm ready to add in an Event Manager system.
I know, in theory, what an Event Manager should ...
