16
votes
3answers
3k views

Is there any harm in having the main game loop run uncontrolled?

I was wondering if there is any possible harm when my game loop runs as fast as the system allows? I currently have a loop, that, by measuring passed time in nanoseconds, runs the game logic and ...
0
votes
1answer
150 views

Fixing game loop to 60fps makes animation very jittery

ns is 1000000000 / amountOfTicks; long now = System.nanoTime(); delta += (now - lastTime) / ns; lastTime = now; if (delta >= 1) { tick(glad); updates++; ...
1
vote
1answer
157 views

How should I implement the “Observer” pattern with respect to a game world?

I'm thinking of ways to implement the Observer pattern in a game I'm developing at the moment. I can have a Game World (local map) with Game Objects (player, NPCs, monsters etc...) inside of it. Other ...
1
vote
2answers
144 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
0
votes
1answer
119 views

Should I use more than one panel in a java game ?

I' m creating a game in java, and it has this schema: I use the main class to launch my game and I create a frame to add a panel, that is defined into GamePanel class. public class MainFrame { ...
0
votes
1answer
92 views

Java Game Gravity Collision Detection Working Incorrectly

I have searched for this question but was unable to turn up any results - I am making a Java platform game (I have created many top-down games, but nothing with gravity like a platformer) and I have ...
0
votes
1answer
191 views

Game Structure in depth [closed]

I've been curious about game structure for some time now. Does everyone who is a game programmer come up with there own approach to structure there game, or is there like some sort of defined layout. ...
0
votes
0answers
47 views

Space invaders 2d array to represent scene [duplicate]

For code optimization purposes, I want to create a 2d array that contains 40 equal squares (10x10px). Each square represents 1\40 of the displayed window (400x400px). I populate the 2d array with the ...
1
vote
2answers
156 views

Game Design: Faction/Player circular relationship

For a Java game, say I have two classes: Player, representing a player in the game. Faction, representing a faction of players in the game. When the game starts up, all factions are loaded into some ...
0
votes
1answer
579 views

Java High-Resolution Timer for a simple game

I want to work on a model of some kind of simple shape shooter game I would develop for either the desktop or the Android, using the libGDX library. There's something I want to incorporate into the ...
0
votes
1answer
235 views

How should I determine the bounding rectangles for frames within a sprite sheet? [closed]

I have a spritesheet for a character. The spritesheet has several rows, and each row represents an animation. The elements within a row might vary in width. How can I load the different sections of ...
1
vote
0answers
166 views

How to create RPG game message dialogue in Java? [closed]

as per the title, I'm looking for a way to implement message dialogues just like old Dragon Warrior(GameBoy). When the player talks to a clerk at a shop, message dialogues such as "Buy" and "Sell" ...
0
votes
1answer
185 views

Circle-Rectangle collision velocity adjustment

I created my circle vs. rectangle method based on this algorithm: http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection Currently, I have a dynamic ball with ...
1
vote
1answer
186 views

Java: See if Mouse is hovering/clicking Sprite

The game I am developing is in which you defend the Cell from the Viruses, and I need the sprites to have a MouseListener for when the mouse clicks on that sprite, it will get destroyed, and I cannot ...
-1
votes
1answer
508 views

Different Attack Systems in RPG [duplicate]

I'm making a 2d rpg game with libgdx and java, and I'm wondering how I would organize different attack systems - magic, melee, etc. (it's not a turn-based rpg). I have a PlayerClass enum, a Player2D ...
3
votes
2answers
277 views

Spawning entities in groups on a 2d tile-based map

I have a 2d game that generates an "infinite" map of tiles based on a "noise" height map. Each time a new "chunk" of 16x16 tiles is loaded, I have code that randomly chooses a "creature" to spawn into ...
1
vote
1answer
940 views

libgdx: how to manage entity classes [closed]

Good day sirs, I know this is a newbie question but I really need to ask it. I've been reading a lot of sample codes on libgdx, and I have seen entities(player, enemy, boss,etc.). my question is what ...
0
votes
3answers
230 views

Valid gameloops

I've got a thread (gameloop) in my game that is super complicated, and is built with the help of tutorials when I was still a beginner. But now that I understand a bit more, I find myself wondering ...
-1
votes
1answer
127 views

Android TCG structural design [closed]

I started developing tcg for android, using ADT bundle. What is the right approach/way for making/storing cards/game info, local sqlite, some kind of data file? some service? or something else?
-1
votes
1answer
194 views

Get distance between the edge of screen and a moving sprite

How to get the distance between the edge of the screen and a vector moving sprite? I want to get the distance between my moving sprite and the edge of the screen so that when my sprite touches the ...
8
votes
2answers
2k views

Java 2D game programming: Different approaches to make a game loop

I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop: 1. The standard approach, that uses the Timer class ...
4
votes
4answers
422 views

Storing data for a pokemon like game

The game I'm developing is close to Pokemon. How should I store the data? I am currently thinking of text files where I save the map and have a corresponding textfile for the trainers and their teams ...
0
votes
1answer
159 views

Android activities, when to use them?

I'm getting back into programming my game and I can see that I've used activities for so many things. I only have one with a custom-view (my actual game), the others are activities with XML-views, ...
5
votes
1answer
801 views

RPG game engine. Skill application calculations

Short preface I am a part of a small team which is entering game development. We're creating a new RPG setting with custom game system and mechanics based on dice rolls. I'm server-side java ...
0
votes
5answers
536 views

Does Java support OpenGL by itself?

Note: This is long but I explaining everything that you need to know. Don't read half way through it and say "What's the question?". It's simple but long and I need help as soon as possible. So I ...
1
vote
1answer
1k views

Can I mix OpenGL and swing?

I'm working on a small game library for me and some people I know that just handles the window and nothing special that we weren't gonna use. I know how to use OpenGL and stuff I just don't like ...
4
votes
1answer
971 views

Need info on creating a tile grid data structure in Java

I'm trying to create a game with a fixed size map (2D Tile array). I suppose I can inherit other tiles from this base Tile, e.g.: a BankTile. Placing and removing tiles is all too easy, but forming ...
1
vote
2answers
625 views

How to implement a birds eye view of 2D Grid Map using Android

I'm a true beginner with using the android platform and I'm having difficulties on implementing a 2D grid system for a tower defense type game. Where I can place towers on a specific tile and enemies ...
1
vote
3answers
999 views

How to Handle frame rates and synchronizing screen repaints

I would first off say sorry if the title is worded incorrectly. Okay now let me give the scenario I'm creating a 2 player fighting game, An average battle will include a Map (moving/still) and 2 ...
0
votes
1answer
880 views

Managing Game States

I'm thinking about making a StateManager for my game. I want to know how to design it; that is, how to use a stack to push and pop states onto, and draw them to the screen. For example, should each ...
-1
votes
2answers
2k views

Breakout ball collision detection, bouncing against the walls

I'm currently trying to program a breakout game to distribute it as an example game for my own game engine. http://game-engine-for-java.googlecode.com/ But the problem here is that I can't get the ...
0
votes
4answers
301 views

How to run around another football player

I have finished a simple 2D one-on-one indoor football Android game. The thing that it seemed so simple to me, a human being, turned out to be difficult for a computer: how to go around the opponent … ...
1
vote
1answer
145 views

What web technology could I use which would support a decision tree?

I am a big game development fan but I haven't done any commercial work in the past. I have been asked by a non-profit to look at developing a game similar to the award-winning www.playspent.org They ...
0
votes
1answer
342 views

Effectively implementing a game view using java

I am writing a 2d game in java. The game mechanics are similar to the Pokémon game boy advance series e.g. fire red, ruby, diamond and so on. I need a way to draw a huge map maybe 5000 by 5000 pixels ...
4
votes
1answer
396 views

Store data on server or only in database?

I have been working on programming an online RPG in Java for a while now. It's a huge project and way too hard for me, but I'm having fun learning. server and client: Java database: MySQL I have ...
-2
votes
3answers
350 views

Client Server what do i need?

Simple question if the Client is Android Game App That send data to the server for Storing/Recalling Data as well as calculating data? I hear sql is good for simple database stuff.what is good for ...
-4
votes
1answer
932 views

should i use java or c#? [closed]

i know a similar question has been asked before but, my question is somewhat different. I have been learning C# for a few years but nothing in game making, more like applications and web like ...
2
votes
1answer
310 views

Implementing Object Composition

I'm trying to structure my game object classes similar to how it is done in this article. One way to implement this strategy is discussed in this StackOverflow question. Following the strategy ...
2
votes
2answers
483 views

Designing a unit combat system (java)

I am looking to make a program that will allow me to test units for balance when in combat. The idea is that there will be two teams of so many units of different types. I would loop through a battle ...
4
votes
1answer
1k views

Android Game Dev: Screen Scaling

This question is very closely related to a previous question of mine: Scaling a game view with letterboxes? My game runs at 480x800 right now but when the screen is smaller or bigger than that I ...
3
votes
2answers
1k views

Need Ideas for Game [closed]

I've been through a year of programming and have the tools to create a cool, simple 3d game using Java. The biggest problem I have is ideas. When you have no idea how programming works, you want to ...
17
votes
14answers
1k views

Advice for a first year CS major

I'm coming to the end of my first year of CS which has been primarily a Java based course. I'd like to get my feet wet with some game development but I'm not sure where to start. Some people have ...