Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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
1  Game Development / Newbie & Debugging Questions / Re: Problem with pixel art filter on: 2013-08-24 13:17:09
This is the code of the zombie.
http://pastebin.java-gaming.org/f78ee9d8a6a

And here a screenshoot.
2  Game Development / Newbie & Debugging Questions / Problem with pixel art filter on: 2013-08-24 00:23:12
Hey guys I've a problem a bit strange... I've a pixelated player, I apply the FILTER_NEAREST to rescale the player without smoothing, but sometime, the player is smoothing... o.O I don't change anything though the filter seems don't work.
3  Game Development / Newbie & Debugging Questions / Re: Platform collisions problems on: 2013-08-09 10:59:42
Thanks I made two "platform" objects to test but I don't usually do that Grin
By the by, do you know how can I fix the error of the game to check horizontal collisions at the same time as vertical collisions?
4  Game Development / Newbie & Debugging Questions / Re: Platform collisions problems on: 2013-08-08 18:42:20
Cry This damn thing is very frustating! Guys, I've tried all you said and it "works" but not as I want, I know how to detect collisions, what I don't know how to make is to use those "collisions".

For example if the player is above a platform, then it shouldn't be able to cross it, but if there's another platform and the player collides with it "horizontally" then, it shouldn work too. My problem is that when the "player" detect the "floor" it doesn't detect the "horizontal" collisions of the second. :S

This is my code, I hope you can understand it Smiley

http://pastebin.java-gaming.org/7f90d1e7c64
5  Game Development / Newbie & Debugging Questions / Re: Platform collisions problems on: 2013-08-07 23:01:18
I've read it and I've tried to do what the guide says, but how can I use it with gravity?
6  Game Development / Newbie & Debugging Questions / Platform collisions problems on: 2013-08-07 21:57:24
I NEED HELP!

Guys I need help with tile collisions, I think my problem is easy to fix, but I don't know how fix it.
My problem is that I know how to "detect" collisions with tiles, but I don't know how use them.
For example, imagine:

The player is above a platform (how can the player be above that platform without cross it?) and above that platform, there is another platform, then the player should check collisions between itself and the platform of the floor and besides it should check collisions between itself and the second platform above the floor.

Basically what I want to make is a platform game, but I don't know how to make the collision system, My tiles are "squares" so it doesn't has ramps.

Could someone explain me what to do or give me a guide or tutorial?

P.S. I hope you understood what I said

Thanks you very much! Cheesy
7  Game Development / Newbie & Debugging Questions / Re: Flipped image doesn't rotate on: 2013-06-12 13:14:33
I've commented the flipped image because it didn't work. Wink But I've tested it without comment and it doesn't work. It renders but with no rotation.
8  Game Development / Newbie & Debugging Questions / Flipped image doesn't rotate on: 2013-06-10 16:53:46
Hello and today my question is why if I flip an image, this doesn't rotate? How can I rotate a flipped image?

Flipped image, it doesnt' rotate.
1  
2  
3  
image.setRotation((float)angle);
flipped = flip;
//image.getFlippedCopy(flip, false).draw(position.getX() - camera.getX(), position.getY() - camera.getY(), scale);


Not flipped image, it rotates perfectly
1  
2  
3  
image.setRotation((float)angle);
flipped = flip;
image.draw(position.getX() - camera.getX(), position.getY() - camera.getY(), scale);
9  Game Development / Newbie & Debugging Questions / Re: Horizontal collisions on: 2013-06-10 16:50:53
Thanks you very much Smiley It's solved
10  Game Development / Newbie & Debugging Questions / Re: Horizontal collisions on: 2013-06-10 13:22:13
Sorry for my explanation. Smiley Really what I want to do is "separating both collisions". I wanna say, don't mix the vertical collision with the horizontal collision. Actually they're mixed and it's very strange because every time I'm near a wall the code says "eh you're together a block then you must be on the top of this block". I don't want that the player go to the top of the tile when the player is together a wall :S
I hope you understand better this explanation.
My collision code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
public class Collision {
   
   public Collision () {
     
   }
   
   public void Update(Camera camera, Player player, Level level) {
      for (int i = 0; i < level.getMap().length; i++) {
         for (int j = 0; j < level.getMap()[i].length; j++) {
            if (level.getMap()[i][j] != 0)
               Check(i, j, camera, player, level);
         }
      }
   }
   
   private void Check(int i, int j, Camera camera, Player player, Level level) {
      if (player.getPosition().getX() - camera.getX() > i * level.getBlockSize() + level.getBlockSize() - camera.getX() ||
            player.getPosition().getY() - camera.getY() > j * level.getBlockSize() + level.getBlockSize() - camera.getY() ||
            player.getPosition().getX() - camera.getX() + player.getPosition().getWidth() * player.getScale() < i * level.getBlockSize() - camera.getX() ||
            player.getPosition().getY() - camera.getY() + player.getPosition().getHeight() * player.getScale() < j * level.getBlockSize() - camera.getY()) {
      } else {
         player.onFloor(j * level.getBlockSize(), camera);
      }
   }
}


OnFloor(player functon)
1  
2  
3  
4  
5  
6  
public void onFloor(float j, Camera camera) {
      jump = ((position.getY() + position.getHeight() * scale) - camera.getY() >= j - camera.getY());
      if (jump) {
         position.setY((j-camera.getY())  - (position.getHeight() * scale - camera.getY()));
      }
   }


Thanks you very much @relminator for the link but I saw your post before I asked this and I didn't understand it so well :S Anyway thanks you Cheesy
11  Game Development / Newbie & Debugging Questions / Horizontal collisions on: 2013-06-09 20:35:58
Hello guys I don't know how to check horizontal collisions on a tile map Cry I can check vertical collisions and they works perfectly but I don't know how to check horizontal ways. My problem is if the player is near the "tile" horizontal collision works but the player is teleported to the top of the tile. :S It's a platform game and I hope you understand what I mean
12  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-15 17:44:21
I don't know what is its function, I just was testing Smiley. And Now I've a problem with that line, I deleted it and now The line doesn't rotate..
13  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-15 16:03:06
Okay I've recorded a little video
http://screencast-o-matic.com/watch/cIfoDeV3gM

So I hope this is helpful

P.S. Sorry for the video poor quality, That's a bad webpage but I didn't want to upload the problem to youtube. And on my PC, the rotation is faster...
14  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-14 14:58:50
Guys, I don't know if you didn't understand me or I don't understand you. My problem isn't to rotate the line, because I can rotate it perfectly, my problem is stop the rotation once it has the correct angle.
15  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-14 09:51:23
Oh sorry for don't write a bigger description of my problem.

Okay I've a little 2D game. Where the player can shot. So, I need rotate the "bow" in function of the mouse position. Really my problem isn't rotate the player, because I made it more or less. My problem is I can't stop the rotation. My problem is, when I move the mouse, the player rotate yes, but it stops never. So I want that when the player has rotated then stop. I don't know how to make that.

Here's my code

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
public void rotate(double x, double y, double cx, double cy, double n) {
      double dx = x - cx;
      double dy = y - cy;
      double r = Math.sqrt(dx*dx + dy*dy);
      double a = Math.atan2(dy, dx);
      a -= n / 180 * Math.PI;
      this.x = cx + r * Math.cos(a);
      this.y = cy + r * Math.sin(a);
   }
   
   public void render(Graphics g) {
      //image.draw((float)x, (float)y);
     g.setColor(Color.red);
      g.drawLine((float)x, (float)y, (float)x2, (float)y2);

   }
   
   public void update(GameContainer container) {
      Input input = container.getInput();
      rotation = Math.atan2( input.getMouseY() - 600/2, input.getMouseX() - 800/2 );
     
      rotate(x, y, x2, y2, rotation);
   }
16  Game Development / Newbie & Debugging Questions / Rotate player in relation to mouse position on: 2013-04-14 09:30:01
Hey guys, today my question is.... How can I rotate the player in relation to mouse position?

I tried to make it, but the player was rotated always without stop :S
17  Game Development / Newbie & Debugging Questions / Expand background & Slick2D doubts on: 2013-03-30 23:41:59
Hello, I've a problem with my background. My background is very little. So Is there some way to expand my little background when I maximize the window? Don't matter if my background will be pixelated when I expand it. I'm using Slick2D and by the by. I've a doubt with Slick2D, I don't know if I can commercialize my game made with Slick2D. So, Can I make a commercial game with Slick2D?
 Cheesy
18  Game Development / Newbie & Debugging Questions / Re: Scrolling Tile Map with Slick2D on: 2013-02-13 15:41:15
Hum... how can do it? The int and offset, (i know how to make a java int variable), so is the first time I work with a scroll of a tilemap and I don't know how to do it.  Undecided
19  Game Development / Newbie & Debugging Questions / Scrolling Tile Map with Slick2D on: 2013-02-12 21:34:36
Hey guys... i'm making a game with tile maps and i'm using Slick2D, so how can i make the screen scrolling? I'm pretty confused with this :S and basically I don't know how to do this. ^^
20  Game Development / Newbie & Debugging Questions / Re: How to call my jar and jinput with a "script" on: 2013-01-11 16:20:44
I'm using java, with jinput not lwjgl. The problem is when i play the script file, it doen't execute the jar.. And i cannot see nothing at the console. When i execute my jar with "natives" but without jinput. I can see in the console "INFO: Failed to load library: no jinput-linux in java.library.path" :S
21  Game Development / Newbie & Debugging Questions / Re: How to call my jar and jinput with a "script" on: 2013-01-10 15:41:27
T.T I've problem with that, T.T when i make the script with jinput it doesn't work :S but it works with my jar alone. Must i modify manifest file?
22  Game Development / Newbie & Debugging Questions / How to call my jar and jinput with a "script" on: 2013-01-09 14:40:17
Hi, guys Cheesy how can i call to jinput and my jar wiith a script? In my last post i ask how to release my app, and yeah they said me that, but how can i do the script for my app, a can't do it, i don't know how to do it :S Thank
23  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-06 15:36:54
how can i merge the jar?
how can i activate jinput for win & mac too?
24  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-06 13:13:41
but how can i "use" my jar with jinput. the error is
INFO: Failed to load library: no jinput-linux in java.library.path
25  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-06 12:44:15
:S GUYS!! Sad, how can i call the "java jar" with the script... So it's works perfectly but  don't know how to load jinput too :S
26  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-05 14:16:24
:S Okay Cheesy then a normal installer without updating
27  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-05 11:48:11
You could create a launcher, which the user will download.

The problem is i don't know how to make it :/
28  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-04 22:14:57
Thank Cheesy and the last question, could you explain to me what's this
1  
-Djava.library.path. any dependencies 

what does it do?

Sorry for too question, it's the first time i release a java app :S
29  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-04 22:02:16
Excuse me :S, how the script? What kind of script(.sh,.bat)? How can i do for window and linux? I don't know very much about that
30  Game Development / Newbie & Debugging Questions / Re: How to release my app? on: 2013-01-04 19:32:29
My game is not big but without installer is "too" tatty  Tongue

So how can i do the "program" or shell script :S? Cheesy
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (14 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (59 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!