Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (855)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: 1 2 [3]
61  Game Development / Newbie & Debugging Questions / Canvas Size Problem on: 2012-11-26 22:38:06
I am having a problem with limiting the size of my canvas.

I am setting it to be 576 by 1024, but it ends up being created wider than it needs to be.

Note: red area = the proper size of the canvas, orange = the actual size of the canvas.



I am using setSize, setMinimumSize, setMaximumSize, and setPreferredSize, but it still shows the canvas as larger than it should be.

Thanks,
novasharp
62  Java Game APIs & Engines / Java 2D / Rectangle rendering issues on: 2012-11-26 20:56:10
I am rendering rectangles using this code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
for(int r = 0; r < map.height; r++) {
   for(int c = 0; c < map.width; c++) {
      if(!map.getTile(c, r).passable) {
         gr.fillRect(
            (int)(c * GameComponent.tileSize),
            (int)(r * GameComponent.tileSize),
            GameComponent.tileSize,
            GameComponent.tileSize
         );
      } else {
         gr.drawRect(
            (int)(c * GameComponent.tileSize),
            (int)(r * GameComponent.tileSize),
            GameComponent.tileSize,
            GameComponent.tileSize
         );
      }
   }
}


For some reason, the edges of the outer filled rectangles render slightly off.



I cannot figure out why?

Thanks,
novasharp
63  Game Development / Newbie & Debugging Questions / Re: Gamepad Deadzone on: 2012-11-23 16:30:54
I am using JInput.

the Gamepad class that I am using is just a quick wrapper around it to find the first gamepad and get the values from it.
64  Game Development / Newbie & Debugging Questions / Gamepad Deadzone on: 2012-11-23 14:27:37
Hi,

I am using a gamepad to control the movement and direction of my sprite.
My problem is that when I let go of the analog stick, my character turns to a random angle.
This is how I am determining the angle of my sprite:
1  
r = Math.PI / 2 + Math.atan2(gamepad.getYLeft(), gamepad.getXLeft());


Thanks,
novasharp
65  Game Development / Game Mechanics / Re: Reusable A* on: 2012-11-19 23:27:27
In my code, I have multiple moving entities each with their own different destinations and start points. I need to do pathfinding for each of those entities. I think I figured out a solution which is to have each node store a reference to the start and end nodes. If these change, then I recalculate the score for that node (g score only, h score is always recalculated).
66  Game Development / Game Mechanics / Reusable A* on: 2012-11-08 22:02:55
Hi, I wrote an A* program, but the problem is that it would only work with one object at a time. Is there a way to do dynamic pathfinding (target is constantly moving, but moving slowly) that would not require resetting all the scores each time I tried to find a path. Or would the time be so insignificant that it would not matter?  Huh

Thanks
Pages: 1 2 [3]
 
EgonOlsen (1569 views)
2018-06-10 19:43:48

EgonOlsen (1541 views)
2018-06-10 19:43:44

EgonOlsen (1141 views)
2018-06-10 19:43:20

DesertCoockie (1568 views)
2018-05-13 18:23:11

nelsongames (1172 views)
2018-04-24 18:15:36

nelsongames (1549 views)
2018-04-24 18:14:32

ivj94 (2306 views)
2018-03-24 14:47:39

ivj94 (1515 views)
2018-03-24 14:46:31

ivj94 (2602 views)
2018-03-24 14:43:53

Solater (879 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!