1
vote
1answer
113 views

Pokemon Yellow wrap transitions

So I've been trying to make a pretty accurate clone of the good old Pokemon Yellow for quite some time now and one puzzling but nonetheless subtle mechanic has puzzled me. As you can see in the ...
0
votes
1answer
36 views

How do I draw a line using jme3.scene.shape.Line in JMonkeyEngine 3.0?

I can successfully create the object, but it can't be attached to the rootNode. What can I do to make the line appear? I'll also would like to know how to reverse the effect(making it disappear) ...
0
votes
0answers
40 views

Ray-Triangle Intersection Detection using Barycentric Coordinates

I am attempting to convert the algorithm from http://www.cbloom.com/3d/techdocs/fast_ray_tri.txt to java code, but my solution does not function correctly. The only intentional change I made was for ...
2
votes
1answer
100 views

Processing move between tiles with an animation in isometric map

In my isometric map, entities can only be in the center of the floor tile. So it's tile per position. This is my map with an entity: Entity can either move forward, left, or right. Where forward ...
2
votes
1answer
123 views

Drawing tile images with bigger height on floor tiles on 2.5D isometric map

Hello I am creating my first isometric game. I have floor tiles which are 112*56 in size. This is a simple strategy game I am making, it's an existing game, I just copied the idea for practice since ...
0
votes
0answers
13 views

Using Graphics from my Frame's paint() gives cutting effect every call to repaint()

Every frame the run() method of my thread calls the repaint() of the frame subclass, in this frame subclass I override the paint(Graphics) and since I want to have different screens from my game I ...
0
votes
0answers
31 views

Java Graphics Rendering Bug

So I've been playing around with moving objects using KeyListeners and active rendering via while(true) loop. CANVAS.createBufferStrategy(3); BufferStrategy buffer = CANVAS.getBufferStrategy(); ...
0
votes
0answers
90 views

ShapeRenderer is pixelated in libGDX

When I use a ShapeRenderer, it always comes out pixelated. But if I draw the shape in photoshop with the same dimensions, it's very smooth and clean-looking. My method is just as follows: package ...
7
votes
2answers
399 views

Java single Array best choice for accessing pixels for manipulation?

I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered ...
0
votes
1answer
59 views

TiledMap resizing and aspect ratio with LibGDX

I'm making a game and I don't know how to resize my TiledMap when the window is bigger but keeping its squared shape. Here is a screen: When I change window size, here's what happens: I want ...
0
votes
1answer
88 views

How can I center an arbitrary string over a sprite?

Eyesore: The problem is, the text should be exactly centered over the player, I want something like this: My code to draw username above the player is: g.drawString(username,(int) playerX,(int) ...
1
vote
2answers
88 views

How do I scale a rectangle image while retaining its border thickness?

I want to create a programmatically scalable image like this: scales to . Both have a one pixel border. If I scaled from the first to the second in Paint.NET, there would be a two pixel horizontal ...
0
votes
0answers
17 views

how to construct an efficient game loop and add graphics to it [duplicate]

I am reading killer game programming in java and reffering to foriegnguymike on youtube. I think my game loop is ok but someone said not to use thread.sleep() and i'll work on it. For now based on ...
0
votes
2answers
181 views

Do Java and Actionscript use OpenGL?

As far as I know there are only 3 base graphics libraries on Windows, the GDI, OpenGL and DirectX, is that correct, so that means that Java, Actionscript and all language use one of these 3 libraries ...
0
votes
2answers
66 views

Clamping large content to smaller area

I'm using OpenGL (with LWJGL) in Java, but the question is language independent. I have some region (a rectangle for simplicity), and, let's say, a big tiled map which I want to show in this area. ...
0
votes
1answer
229 views

How can I draw a single line using JMonkeyEngine?

I need draw a line between two boxes using their respective positions. I've created the Line object but I don't know how to show it in the scene. Line ray = new Line(box1.getLocalTranslation(), ...
5
votes
1answer
430 views

How can I create a 3D model in Java without using modeling software? [closed]

I am a lightly experienced game developer and this is my first time trying 3D objects in Java for the first time. I have been recently creating and updating games using AWT, Swing, and Graphics, but I ...
0
votes
1answer
274 views

Java Slick2D - Problem using ScalableGame class

I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library. I would like the background and objects (images and graphic shapes) to adjust to ...
6
votes
1answer
305 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
-1
votes
1answer
103 views

Render white background with Graphics in Canvas

I am developing a game that I would like the background to be white, and it just sticks to being black. Here is my render method: private BufferedImage image = new BufferedImage(WIDTH, HEIGHT, ...
2
votes
2answers
2k views

How to code a Game Grid in Java?

Suppose I wanted to code a game grid in java. Not an abstract text one but an actual grid with graphics and 'cells'. Would I have to draw line by line or is there a more efficient way? Also how would ...
2
votes
0answers
283 views

OpenGL: Attempt to allocate a texture too big for the current hardware [closed]

I'm getting the following error: java.io.IOException: Attempt to allocate a texture to big for the current hardware at ...
1
vote
1answer
156 views

How can I find the location of OpenGL object after rotation?

I have a rotating object, a cube, which I rotate in OpenGL as follows: gl.glPushMatrix(); gl.glTranslatef(400.0f, 300.0f, 1300.0f); gl.glRotatef(m_x, 4.0f, 0.0f, 0.0f); gl.glRotatef(m_y, 0.0f, 4.0f, ...
2
votes
0answers
116 views

Images out of “sync” [closed]

I've been creating a game in Java as a bit of a fun side project over the last few months and I've come across a really peculiar problem, take a look at this image: The game is made up of various ...
-1
votes
1answer
111 views

Anti-Aliasing in Java

In my game I want to have the different anti-aliasing option like: none, x2, x4, x8 and x16. I know that you can use anti-aliasing with Graphics2D in the way below bu is there any way that I can use ...
1
vote
4answers
255 views

Changing color of a moving image without lowering the fps

I just added an option to my game that makes it so that all the enemies will have a random color for their clothes instead of the regular blue. I use this code to draw rectangles over the shirt of the ...
1
vote
1answer
640 views

Jogl2 won't accept jogl 1.0 code - GL_LIGHTING and GL_LIGHT_MODEL_AMBIENT cannot be resolved or is not a field?

I'm trying to run my code on jogl 2.0 , for the first time (until now I worked with jogl 1.0) however Eclipse throws to almost every that I have a "cannot be resolved or is not a field" message . ...
2
votes
1answer
204 views

Low FPS on Java drawing in BufferStrategy

I ran into a very strange problem while using BufferStrategy, I've tried searching for an answer but all I have found are non-relevant threads and discussions. So here is my query. for (int i = 0; i ...
4
votes
1answer
966 views

2D Software Lighting Issues in Java

I'm creating a 2D top-down tiled game in pure Java and by now I'm trying to implement a way to do lighting. First, some details on how I render: there is a screen class which handles all the ...
0
votes
1answer
84 views

Which Swing control should I use to render graphics with?

I'm using the Swing UI toolkit in Java, and I want to use the Graphics class to draw images and grids in a control. Which is the most appropriate control for this?
-2
votes
1answer
219 views

Move projectile in direction the gun is facing [duplicate]

Possible Duplicate: Move sprite in the direction it is facing? I am attempting to have a projectile follow the direction a gun is facing. When using the following code I am unable to make ...
0
votes
3answers
994 views

How do you make bullets move at an angle in different angles using delta

I'm having trouble making my bullets move at a steady pace using delta. I have the formula I used outside of slick2d, but it doesn't take delta into account. My bullets fly fast. How do I make them go ...
0
votes
1answer
395 views

Can't remove JPanel from JFrame while adding new class into it

Basically, I have my Frame class, which instantiates all the properties for the JFrame, and draws a JLabel with an image (my title screen). Then I made a separate JPanel with a start button on it, and ...
1
vote
3answers
2k views

Question about JPanel “transition” for Java Swing

I want to make like a sort of main menu (in GUI). When the user clicks the start button, the screen transition into another "screen" (JPanel). This image will make it easier to understand. ...
4
votes
2answers
304 views

Minesweeper: Mouse listener problem

I have wrote a code for game Minesweeper and there is no problem with the graphics,but there is some problems with MouseListener. Here is my code /* * To change this template, choose Tools | ...
1
vote
2answers
1k views

Provide A Scrolling “Camera” View Over A 2D Game Map

I'm in the process of attempting to create a 2D MMO type game with Kryonet and some basic sprites, mostly for my own learning. I have the back end set up great (By my standards) and I'm moving on to ...
1
vote
1answer
2k views

Using NinePatch in libGDX for Loading Bar

I am trying to create images for a loading bar in libGDX. I came across the NinePatch class and I was hoping to use it for this loading bar, since stretching images with a plain Texture or Sprite ...
1
vote
1answer
647 views

Polygon Collision Detection Android

I am starting to try and figure out polygon collision detection in my Android game. I am currently doing pixel level collision detection and it just seems to be too slow (though it works). I was ...
4
votes
4answers
2k views

Which Side Was Hit?

I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
6
votes
2answers
3k views

How to handle pixel-perfect collision detection with rotation?

Does anyone have any ideas how to go about achieving rotational pixel-perfect collision detection with Bitmaps in Android? Or in general for that matter? I have pixel arrays currently but I don't know ...
0
votes
1answer
934 views

How can I “capture” the section of my sprite sheet that I want to draw in Java?

I'm working on a puzzle game, I've implemented a sprite class that uses an array of images and cycle through the array to draw each frame as required. This works fine! Here's the original code: ...
3
votes
1answer
192 views

Can I use one set of images to represent multiple sprites in Java?

I've got a game that has 3 basic sprites, at the moment I'm loading 8 images into each sprite for animating. Each character class has a sprite object. if I've got 10 characters on screen at once ...
2
votes
2answers
3k views

How do I prevent flickering when drawing to a JPanel?

So I have a JFrame holding a JPanel, to which I'm drawing at about 60 FPS. I've been told that "Swing is double buffered by default", but, nevertheless I'm getting massive flickering. At first, I ...
1
vote
1answer
952 views

Sphere collision response

I have simple mechanism for testing of two balls colliding: private static boolean isColliding(float firstBallX, float firstBallY, double firstBallRadius, float secondBallX, float secondBallY, double ...
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 ...