game-development

Android game goes blank after pressing home and restarting

I am making an Android game with an Activity called Game, a SurfaceView called GameView and a Thread called GameThread. The Game's onCreate(), I make a new GameView, which makes a new GameThread, where all the game logic and canvas drawing is carried out. However, I'm having some lifecycle difficulties. When I press back and restart it,...

Cross platform millisecond timer lasting more than 49 days?

Hey guys, I'm going to be developing a small dedicated server in C/C++ that will require uptime of forever. I've been looking into some time functions as millisecond timing is required for calculations. I have 2 problems that I'm facing: Using a 32bit integer to store the number of milliseconds since the operation began will wrap ar...

J2ME Slow bluetooth connection

Hello, I am working on a simple game using the mobile phone emulator in netbeans. The game works fine and the screen is updated when it needs to be. Whenever a ball moves, it sends the position of the ball to the other handset (in this case emulator). But when ever anything goes outwards on the OutputStream on the bluetooth connection,...

Multiple Input From Keyboard C# WPF

I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt ...

Android Orientation

For a game I am trying to create for Android I am looking for a way to use/access the orientation yaw/pitch to move the player left or right. Does anyone know how to do this, or where to find a tutorial? ...

Algorithm to detect no movable pieces in Stratego.

I am creating a Stratego Game and am having trouble creating an algorithm that can detect when there are no more possible moves because all your pieces are gone or the remaining pieces are unmovable or trapped by forbidden squares, unmovable pieces, or other trapped pieces. For simplicity you can think of the board as an array of Square...

Box2d: Set active and inactive

I'm writing an XNA game in C# using the XNA port of Box2d - Box2dx. Entities like trees or zombies are represented as GameObjects. GameObjectManager adds and removes them from the game world: /// <summary> /// Does the work of removing the GameObject. /// </summary> /// <param name="controller">The GameObject to be remo...

Tips regarding how to create an Java Solitaire game.

I got some question regarding the approach to create an solitaire game in java. What is the best way of handling the cards in Swing? How can I drag them, and what is the best way to snap them into their right positions? ...

XNA: What is the point of Unload()?

XNA games have an Unload() method, where content is supposed to be unloaded. But what is the point of this? If all the content is being unloaded, then the game must be exiting, in which case everything would be garbage collected anyway, right? ...

Conway's Game of Life - C++ and Qt

I've done all of the layouts and have most of the code written even. But, I'm stuck in two places. 1) I'm not quite sure how to set up the timer. Am I using it correctly in the gridwindow class? And, am I used the timer functions/signals/slots correctly with the other gridwindow functions. 2) In GridWindow's timerFired() function, I'm ...

How to set probability for the sprite in shooting game ?

My game is a small shooting game in cocos2d. The enemy generates the bullets to shoot player at intervals of time. I have created a random y , so that bullets touch the opposite edge at random heights. If the bullet touches the player the enemy wins. But, I need to set probability for the enemy accuracy. If the probability of enemy is gi...

Bejeweled Blitz - How does it assert there is always a move?

I have been playing Bejeweled Blitz for a while now. Yes, it is an addiction. In thinking about the game, I have observed that on some boards, the bottom runs dry (no moves) leaving only the top part of the board playable. Frequently that part of the board drys up, and one is left with moves in area cleared by the last move. The bo...

ScoreNinja causes java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() Here is part of the call stack: android.os.H...

Generic FSM for game in C++ ?

Hello, I was wondering if there's a way I could code some kind of "generic" FSM for a game with C++?. My game has a component oriented design, so I use a FSM Component. my Finite State Machine (FSM) Component, looks more or less this way. class gecFSM : public gecBehaviour { public: //Constructors gecFSM() { state = kEntity...

How do I hook into a game and write a script to manipulate it?

Hey SO, I know this is a pretty open question but I was wondering how people go about writing scripts that will "play" a game, or manipulate it in some way. I had been thinking that I'd try to get a working AI to play a game for fun, but don't even really know where to start. Are there any good resources to learn this? What are good ...

iPhone referencing my own word list for a Word Game

Boy, I've got everything down-pat save the word referencing. The game crashes because of the size of NSMutableArray. What's the best way to create a word list that can be referenced without encumbering memory? Thanks! ...

Powder Physics Games

Does anyone have any experience with this sort of thing? I'm talking about applets like this http://dan-ball.jp/en/javagame/dust/ I'm really interested in how they work, it seems more like fluid-dynamics than regular game physics. Does anyone know any open source variations, or any hints on how they might work? I think it would be real...

iPhone app: How to implement in-app purchased game levels

So, I understand that it's possible to set up in-app purchases for iPhone apps to purchase non-consumables like game levels. I understand the logic behind the purchase part, but what I don't understand is, how can I deliver the new game level. For example: I build an app that contains the first level and they purchase additional levels....

Best code structure for arcade games

Hi, I've developed a few arcade games so far and have the following structure in almost all of them: I have 1 file which contains a class called kernel with the following functions: init() welcome_screen() menu_screen() help_Screen() play_game() end_screen() And another file, called Game, which basically calls all these functions and...

iPhone Game Having a statement checked every 50 points

Hello! I've run into a little hurdle and wanted to see if somebody could help me! I want to write an algorithm for an if statement that says: if (for every 50 points) { //do something } I thought += 50 would do the trick, but nope. Any ideas? Thanks! ...