After some tweaking of some code I got from someone to cause a characters images to move in regards to its direction and up down left right input I've put this together: (hope the code isn't too messy)
Character Move Code + IMG
The Sprite sheet only runs lengthwise, so basically each sprite section is a different action. Now would ther...
Hey guys!
I'm working on a Java Bomberman clone, using a grid system, and I'm not really satisfied with the movement right now. When the player presses a movement key, the character starts to move (with 0.25 speed). The player loses the control, and the character keeps moving until it has moved a full tile. The player only regains contr...
I am looking for a function or example to produce a list of lines representing contours at a specific height within a heightmap.
Eg,
Lines[] = GetContours(Heights[512,512], HeightValue)
Where Heights is a 512x512 array of floating point values, HeightValue is the height at which the contour should be drawn. Heights may contain multip...
I have four 2d points, p0 = (x0,y0), p1 = (x1,y1), etc. that form a quadrilateral. In my case, the quad is not rectangular, but it should at least be convex.
p2 --- p3
| |
t | p |
| |
p0 --- p1
s
I'm using bilinear interpolation. S and T are within [0..1] and the interpolated point is given by:
bilerp(s,t)...
Hello I'm having trouble rendering correctly sprite with SlimDX. It draws a little scaled just like .NET Drawing DrawImageUnscaled does. I'm not using any transformations.
Init:
Vector2 position;
Sprite sprite;
Size size;
Texture texture;
sprite = new Sprite(Device);
string filename = /*some bitmap*/;
using (Image b = Bitmap.FromFile(f...
Is there any way to build paths in Cairo by combining two paths together through Boolean operations such as Union, Difference, and Intersection? I'm working on a vector graphics application that uses Cairo to do its rendering and would like to give my users the ability to combine paths together in this manner, but I can't find a way to d...
I'm looking for open source projects for card games like Black Jack or Solitaire to get an idea on some GUI/Mac OSX desktop programming. I'm curious if anyone knows of any that're based on Objective-C/Cocoa that I can read/learn from?
...
I'm writing a simulation in which a creature object should be able to move towards some other arbitrary object in the environment, sliding around obstacles rather than doing any intelligent pathfinding. I'm not trying to have it plan a path -- just to move in one general direction, and bounce around obstacles.
It's a 2D environment (ove...
I have a sprite loaded from a PNG that has an alpha channel. The image contains an opaque disk, and the rest of it is transparent.
I want to use the color argument of SpriteBatch.Draw(...) to change the tint of the disk. However, the default blending behavior applies the color to the entire sprite, so I end up with an opaque square outl...
What is the correct way to draw isometric tiles in a 2D game?
I've read references (such as this one) that suggest the tiles be rendered in a way that will zig-zag each column in the 2D array representation of the map. I imagine that they should be drawn more in a diamond fashion, where what gets drawn to the screen relates more closely...
I need to attach text labels to objects that are spread randomly across the screen and keep moving.
The default and ideal position for a label is on the right side of the object it refers to. I need a way to dynamically rearrange (or possibly merge) the labels so that they never overlap each other or other objects.
They should still be...
Can anyone recommend a good Java game engine for developing simple tile-based games?
I'm looking for an engine that will allow me to build maps using something like Tiled www.mapeditor.org
Slick is exactly what I'm looking for, slick.cokeandcode.com but I can't get it working on Vista-64. The best I can manage is:Can't load IA 32-bi...
I'm looking for information on how to move (and animate) 2D sprites across an isometric game world, but have their movement animated smoothly as the travel from tile to tile, as opposed to having them jump from the confines of one tile, to the confines of the next.
An example of this would be in the Transport Tycoon Game, where the trai...
I have been all around with this question and I can't find the correct answer! So, behold, the description of my question:
I'm working in J2ME, I have my gameloop that do the following:
public void run() {
Graphics g = this.getGraphics();
while (running) {
long diff = System.currentTimeMillis() - lastLoop;
...
I want to write a very simple game in Java to demonstrate a wireless controller I've built. I thought of something like Breakout or Pong. Currently, I have a prototype Pong implementation that does all animation directly using the AWT functionality. However, this is somewhat awkward to program and also a major CPU hog.
My question:
Can...
I'm trying to fill an array in spiral order. So far, I can print the array in spiral order, but is there a way to modify the array so that i can fill it in spiral order and then just print the array? I'd like it to go in decreasing order like a countdown. Please help!
public class Spiral {
public static void main(int m, int n) {
...
I have written a chart that displays financial data. Performance was good while I was drawing less than 10.000 points displayed as a connected line using PathGeometry together with PathFigure and LineSegments. But now I need to display up to 100.000 points at the same time (without scrolling) and it's already very slow with 50.000 points...
Hi,
I am looking for a tutorial which will show me how to do simple 2d physics like the ones in this (http://www.teagames.com/games/tgmotocross/play.php). The part that I am most interested in is how the collision detection is done between the character / player and the terrain, as well as how to store / generate the terrain.
The langua...
Hello,
I'm writing a game that displays 56 hexagon pieces filling the screen in the shape of a board. I'm currently drawing each piece using a singleton rendering class that when called to draw a piece, creates a path from 6 points based of the coordinate passed in. This path is filled with a solid color and then a 59x59 png with an alp...
Hi everyone, I have a rather simple question for you..
I feel like I should have found the answer a long time ago but somehow I can't wrap my head around this trivial problem.
Given a vector v = (x,y) , I would like to know it's 'general' orientation. That is either 'Up', 'Down', 'Left' or 'Right'
A vector's general orientation is 'Up'...