-1
votes
0answers
49 views

AI for enemy in 2d game [on hold]

I need an AI algorithm for enemy in 2d game for aiming at player and shooting. This is a j2me game. The enemy first comes from top and waits few seconds and then moves to left and then goes to ...
3
votes
1answer
54 views

Field of view determination with partially opaque cells

I'm currently implementing the field of view of a player in a 2D-grid based game. I've chosen a standard ray tracing algorithm because he really fits the features needed in my game. However, the ...
0
votes
0answers
21 views

C# 2d array value check [duplicate]

I've managed to create a 2d array, then made it fill up with random numbers, like this: int[,] grid = new int[5, 5] ; Random randomNumber = new Random(); var rowLength = ...
6
votes
3answers
330 views

Need ideas for an algorithm to draw irregular blotchy shapes

I'm looking to draw irregular shapes on an x,y grid, and I'd like to come up with a simple, fast method if possible. My only idea so far is to draw a bunch of circles of random sizes very near each ...
3
votes
1answer
205 views

How do you construct a node map for pathfinding in a non-tiled 2D environment? [duplicate]

A* and Dijkstra's pathfinding algorithms work by navigating a node map. In a tile-based 2D environment, these nodes could easily be inferred to be the literal x,y positions of the map. For example, ...
3
votes
2answers
277 views

What would be the most simple following target and neighbors avoidance algorithm in 2D space on plane?

I have ~20 or more enemies and they need to follow a target and avoid to go on top of themselves. I mean follow a target and avoid to collide with each other. Area, on which they are walking, is just ...
0
votes
1answer
316 views

Pong horizontal movement algorithm

I was just wondering about the horizontal movement of a pong ball? What is the general algorithm used with this? The ball in my pong game just move vertically and I don't know about the algorithms ...
4
votes
1answer
769 views

3D isometric depth sorting

How is it possible to depth sort tiles and objects in an isometric environments without any limitations? I've been researching this for a while now and there seems to be no publicly available answers ...
1
vote
6answers
595 views

Is it good to sort objects list before every rendering?

I need to render a "tile" game, which are like these: or or I don't know how to render them in correct order. I intend to perform a sorting operator before every rendering (depending on their ...
3
votes
1answer
69 views

Retrieve outer most points on a 2d graph

G'day everyone, I have a 2d graph which has some points plotted on it. What I need to do is get only the outer most points so that I can connect them up (isn't really relevant). What I can't seem ...
1
vote
1answer
488 views

Tongue pull effect

I've been searching on the net for several days and can not find nothing about this effect. Even a name for this effect. I want to make a character that can use his tongue to pull objects objects it ...
0
votes
1answer
231 views

Iterating 1D array and getting 2D tile position

I know I'm missing something very obvious here, but I have a 1D array that contains integers.I have a map that is 30 x 30 and the center coordinate is 0,0 (This is actually 3D, but I'm essentially ...
2
votes
4answers
958 views

Efficient path-finding on 2D tile-based multilevel map

It's a question I've been thinking about for some time... How do you effiently find a path on a 2D tile-based multilevel map? The map I use, for example, is 2048 on 2048 tiles wide. It has 14 levels ...
0
votes
4answers
823 views

Storing huge 2D tiled map in a txt file

I'm working on a global startegy game that uses a 2D tiled map. The map is to be 8000x8000 tiles large (this size is fixed, the map stays the way it is throughout the game), since I'm covering a large ...
6
votes
3answers
2k views

isometric drawing order with larger than single tile images - drawing order algorithm?

I have an isometric map over which I place various images. Most images will fit over a single tile, but some images are slightly larger. For example, I have a bed of size 2x3 tiles. This creates a ...
8
votes
2answers
451 views

How do display a “mucus spreading” effect in a 2D environment?

Here is an example of such a mucus spreading. The substance is spread around the source (in this example, the source would be the main alien building). The game is starcraft, the purple substance ...
2
votes
4answers
610 views

Detecting long held keys on keyboard

I just want to ask if can I check for "KEY"(keyboard) that is HOLD/PRESSED for a long time, because I am to create a clone of breakout with air hockey for 2 different human players. Here's the ...
1
vote
2answers
455 views

Rotating multiple points at once in 2D

I currently have an editor that creates shapes out of (X, Y) coordinates and then triangulate that to make up a shape of those points. What will I have to do to rotate all of those points ...
5
votes
2answers
923 views

How can I generate a navigation mesh for a tile grid?

I haven't actually started programming for this one yet, but I wanted to see how I would go about doing this anyway. Say I have a grid of tiles, all of the same size, some traversable and some not. ...
1
vote
1answer
294 views

Ideas for 2d fire simulation [closed]

I want to simulate a fire in a flat and non flat* surface (fire spread modelling). I've seen that cellular automata is one of the algorithms that can be used. Are there other algorithms that would be ...
2
votes
2answers
275 views

Updating “Inactive” Chunks

In my game, the only chunks (4x4 areas of tiles) in memory are the ones that the player is in. However, chunks need to have updates applied to them over time. A (likely) well-known example would be ...
0
votes
2answers
686 views

Order array of points in counter clockwise

I happened to see an answer to "Sort array of points in clockwise", could you please elaborate the 4th point of that answer: sort points relative to their a value, using qsort for instance. How do ...
4
votes
1answer
218 views

Create shape from points / lines in editor and mathematically calculate nearest points within shape

If I want an editor that accepts "points" of a minimum of three (a triangle) and I just add some points first, like this: how can I mathematically connect these corners (points) into an object of ...
4
votes
2answers
439 views

Generate random starting points at same distance between them

Is there an algorithm to generate random 2D points that are at the same distance between each other? Useful for starting points. Check map: Don't be picky, I know in the image points are not at the ...
0
votes
1answer
123 views

How to properly simulate object aproximation towards camera in 2D?

I'm trying to make some objects come towards the camera but it just doesn't feel right... you can check the progress here: http://testing.fyrastudio.com/lab/tweetOlympics/v0.005/ You run by ...
1
vote
2answers
205 views

How can I run and jump at the same time?

I'm having some trouble with the game I started. http://testing.fyrastudio.com/lab/tweetOlympics/v0.002/ The thing is that i have an athlete running and he must jump at the same time. A race with ...
6
votes
2answers
359 views

Algorithm to reduce a bitmap mask to a list of rectangles?

Before I go spend an afternoon writing this myself, I thought I'd ask if there was an implementation already available --even just as a reference. The first image is an example of a bitmap mask that I ...
3
votes
2answers
574 views

What is the appropriate way of placing game objects in a 2d game?

I'm developing a 2d game for Android.It will be an endless game.I have some items like coins ,plants and other special items.How can i place them effectively?Are there any algorithm or any suggestion ...
0
votes
3answers
528 views

Optimizing updating thousands of enemies? (Or break up the enemies that need updated?)

Thanks in advance for wanting to help. I have an array of (right now) ~1000 enemies that I need to update every frame. The issue, I believe, is mainly brute-force checks. I've profiled my ...
2
votes
1answer
240 views

Constrained/penalized distance function

Assume a character is located on a n by n grid and has to reach a certain entry on that grid. Its current position is (x1,y1). Also on the same grid is an enemy with coordinates (x2,y2). Each step ...
4
votes
1answer
102 views

Best approach to get clicked objects from a display list (2D)

I'm implementing a display list to manage my visuals on screen. I want to know which object is clicked. My objects already have z-order variable. With my current knowledge (almost nothing) the only ...
1
vote
0answers
115 views

Fixed time step with Akihabara

How could I implement fixed time step with Akihabara framework? I would like my avatar to move by fixed distances of one block as in Supaplex.
0
votes
1answer
337 views

throw a 2D ball facing the target to simulate a 3D like effect

How would you update the state of a 2D object that is thrown forward(with an arc) facing a target to simulate a 3D(depth) like effect? var ball; //2D ball from a sprite sheet ball.x = 0; ball.y = 0; ...
0
votes
2answers
281 views

Partial recalculation of visibility on a 2D uniform grid

Problem Imagine that we have a 2D uniform grid of dimensions N x N. For this grid we have also pre-computed a visibility look-up table, e.g. with DDA, which answers the boolean query is cell X visible ...
8
votes
1answer
887 views

2D helicopter game, how to create corridor walls?

I'm looking into adapting the classic "helicopter" game (i.e. http://www.addictinggames.com/helicopter.html), but I haven't yet figured out how to create the walls-generation engine. Any pointers ...
8
votes
2answers
669 views

Function for sun movement?

So, given a sun sprite set at the horizon (x = 0, y = worldheight/2) I'm trying to devise a function to make the sun rise, then fall. The best way to do this would be the sin function, but I have no ...
14
votes
5answers
3k views

Quick 2D sight area calculation algorithm?

I have a matrix of tiles, on some of that tiles there are objects. I want to calculate which tiles are visible to player, and which are not, and I need to do it quite efficiently (so it would compute ...
3
votes
1answer
234 views

How can I organize code for views efficiently?

I'm making a video game for the Android platform and I need advice on the overall set up of the activities and views in the code. I don't need actual code, psuedocode will do, but actual code always ...
2
votes
1answer
382 views

How can I make a car follow the terrain in a 2D (side-view) game?

I'd like to create a game where a car drives over a 2D terrain. Which algorithm to use so the car will follow the mountain incline?
49
votes
2answers
3k views

How can I get textures on edge of walls like in Super Metroid and Aquaria?

Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black. I ...
24
votes
4answers
3k views

Finding the nearest object

I have a sizable game engine and I'd like a feature for finding the nearest of a list of points. I could simply use the Pythagorean theorem to find the distances. I know I can't simply add x and y, ...
10
votes
3answers
768 views

Drawing particles as a smooth blob

I'm new to game/graphics development and I'm playing around with particles (in 2D). I want to draw particles close to each other as a blob, just as liquid/water. I do not want to draw big circles ...
9
votes
3answers
7k views

Sorting array of points in clockwise order

Is there such an algorithm to sort an array of 2D points in clockwise order? I'm specifically dealing with right triangle in my case so only 3 points. However I'm interested in knowing if such an ...
10
votes
6answers
3k views

Which is the best approach to make a 2D character to be able to use tons of different equipments when in action?

I want to create a 2D game but I'd like to have the character to wear tons of different equipments on different combinations, like a RPG or something. So let's say the user changes his/her shoulders ...