Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
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]
 
Ecumene (110 views)
2017-09-30 02:57:34

theagentd (146 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (241 views)
2017-08-02 12:19:43

cybrmynd (240 views)
2017-08-02 12:18:09

Sralse (254 views)
2017-07-25 17:13:48

Archive (872 views)
2017-04-27 17:45:51

buddyBro (1024 views)
2017-04-05 03:38:00

CopyableCougar4 (1574 views)
2017-03-24 15:39:42

theagentd (1373 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!