Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 ... 33
1  Game Development / Newbie & Debugging Questions / Re: Voxel Destroy Item on: 2014-07-29 11:47:59
Real o-o Now I think this is a troll post. You mean programmed it to destroy blocks properly, but you cannot figure out how to remove pickaxe? Just remove it from your inventory item list.
2  Game Development / Newbie & Debugging Questions / Re: Levels rendered sideways? on: 2014-07-27 10:18:04
You need to flip y-axis in opengl. (screen.height - y)
3  Game Development / Newbie & Debugging Questions / Re: Tile rendering FPS lag on: 2014-07-26 08:20:17
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
int playerx, int playery;

int xt = playerx/tile.width,yt = playery/tile.height // xt is x tile

int x0 = xt - (screen.width / 2) / tile.width;
int y0 = yt - (screen.height / 2) / tile.height;

int x1 = xt + (screen.width / 2) / tile.width;
int y1 = yt + (screen.height / 2) / tile.height;

for(int y=y0;y<y1;y++)
{
     for(int y=y0;y<y1;y++)
     {
          tiles[x+y*level.width].render();
     }    
}
4  Discussions / Business and Project Management Discussions / Re: what now? on: 2014-07-23 13:31:49
@kevin

Its when their kids aren't at home xD
5  Discussions / Business and Project Management Discussions / Re: what now? on: 2014-07-22 10:57:16
COmmon, we know what he is talking about..
6  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? [solved] on: 2014-07-21 20:07:00
sqrt(32) = 5.656

EDIT-
If you use this, you will get that magnitude = 0.999, which is 1 technically.
7  Game Development / Newbie & Debugging Questions / Re: Learning to create a 3D game in Java! on: 2014-07-21 08:40:45
Why would you want to make 3D game in java? There are a lot of engines out there already made for 3D. Unity etc..
8  Games Center / WIP games, tools & toy projects / Re: ZomGame Puzzel Game Update [15] - PREPLAY!!! 10 Levels on: 2014-07-19 20:29:00
I cannot seem to get to level 7. When I enter the door at level 6, the level 6 restarts.

EDIT-
The controls for me are absolutely horrible.. In the HELP screen, it says to move use ASDW, however, only A and D work. Using AD to move and space bear to jump are absolutely horrible in my opinion.

The physics of the character are horrible too.. Vertical speed feels choppy, and horizontal speed stops instantly upon the key to move on horizontal axis is released.

Other than that, the game is fun!
9  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 15:29:48
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class vec2 {

   public float x, y;

...

   public int getX() {
     return (int) x;
   }

   public int getY() {
     return (int) y;
   }

}


My guess would be that you're using integer positions instead of float positions somewhere.

It's a bit ironic... but... maybe there?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class vec2 {

  public float x, y; // there is a reason these are public



   public int getX() {
      return (int) x;
   }

   public int getY() {
      return (int) y;
   }

}
10  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 14:52:05
My guess would be that you're using integer positions instead of float positions somewhere.
11  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 13:25:58
@panda

Sorry, but in my world, objects are not moving from point a to point b, they are moving in the direction they are rotated to.
12  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 12:56:38
Guess I will go do that, because I can't argue with someone who has 10 times more experience in programming than me.
13  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 12:23:33
Its called abstractions, and while it adds more complexity to the code, the code is easier to read, if you don't need to understand what is happening behind the scenes. 2 lines of very simple code to get the velocities is very small simple to me at least. Besides, you will probably want to render the sprites rotated, in which case you will need to calculated rotation anyway, so whatever.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-19 12:18:20
15  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 12:16:41
Here are a couple of utility methods I wrote that work like a charm:

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  
26  
   public static vec2 point(vec2 pivot, vec2 point, float rotation) {
     
      float rot = (float)(1f / 180 * rotation * Math.PI);
     
      float x = point.x - pivot.x;
      float y = point.y - pivot.y;
     
      float newx = (float)(x * Math.cos(rot) - y * Math.sin(rot));
      float newy = (float)(x * Math.sin(rot) + y * Math.cos(rot));
     
     
      newx += pivot.x;
      newy += pivot.y;
     
      return new vec2(newx, newy);
   }

   public static int angle(vec2 pivot, vec2 point) {

      float xdiff = pivot.x - point.x;
      float ydiff = pivot.y - point.y;
     
      float angle = (float) ((Math.atan2(xdiff, ydiff)) * 180 / Math.PI);
     
      return -(int)angle;
   }


Here is vec2 class.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
public class vec2 {

   public float x, y;

   public vec2(float x, float y) {
      this.x = x;
      this.y = y;
   }

   public int getX() {
      return (int) x;
   }

   public int getY() {
      return (int) y;
   }

}


Now, to get velocities, you do something like this:
1  
2  
3  
float rot = angle(new vec2(player.x, player.y), new vec2(mouse.x, mouse.y));

vec2 velocity = point(new vec2(0, 0), new vec2(0, -speed), rot);


To get x and y velocities, do velocity.x for x velocity and velocity.y for y velocity.
16  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 11:41:05
Here is how you calculate rotation between player and mouse:
1  
float rot = Math.atan2(xmouse - xplayer, ymouse - yplayer);
17  Game Development / Newbie & Debugging Questions / Re: how to do something at the end of a finger drag in libgdx/android? on: 2014-07-19 07:33:54
Might there be something like DragListener instead of ClickListener ?
18  Discussions / General Discussions / Re: What? Your game isn't a pixelated retro masterpiece? on: 2014-07-18 16:00:59
@sabomoth

What are you raging about? Pixelated 2d graphics + (nice lighting + shadows) (smooth) look absolutely amazing.
19  Java Game APIs & Engines / OpenGL Development / Re: Shader not rendering correctly on: 2014-07-17 08:20:37
I would guess that you need to interpolate them, instead of maxing them. (a+b) / 2 should do the trick I think Cheesy
20  Games Center / WIP games, tools & toy projects / Re: MERCury - 2d Game Library | Experimental release in development; test it out! on: 2014-07-16 13:39:01
Just a little side note Stumpy, I think rendering the sprite at its center is just confusing. I think its far easier to render from the corner. In fact I don't think I've ever worked with a library that "auto" renders from the center.

What about libgdx? I think it render in the center.
21  Game Development / Networking & Multiplayer / Re: [Kryonet] Exception when casting received Object (Bug?) on: 2014-07-13 08:23:05
I have never used kryonet, but the best guess would be that KeepAlive is a packet which kryonet sends without your knowledge to not close the connection after certain period of time, or something like that.

Assuming that Packet is an interface or class that you created, you should do this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
@Override
public void received(Connection connection, Object object)
{
    System.out.println(object.getClass().getSimpleName()); // you will see that you receive packets you didn't send.

    if(object instanceof Packet) {
        Packet packet = (Packet) object;
        server.addPacket(new ClientPacket(connection.getID(), packet));
    }
}
22  Game Development / Newbie & Debugging Questions / Re: [GLSL] How to make a gradient shader for background? on: 2014-07-11 09:09:59
How is this?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
void main(void)
{
   float shade = 1.0 - (gl_FragCoord.y / iResolution.y);
   
   
   float blueShade = shade;
   blueShade *= 0.4;
   blueShade += 0.5;
   
   float otherShade = shade;
   otherShade *= 0.5;
   
   int pixelness = 1;
   float power = 50.0;
   
   float r = float(int(1.0 * otherShade * power) / pixelness) / power;
   float g = float(int(1.0 * otherShade * power) / pixelness) / power;
   float b = float(int(1.0 * blueShade * power) / pixelness) / power;
   
   vec4 col = vec4(r, g, b, 1);
   
   gl_FragColor = col;
}
23  Game Development / Newbie & Debugging Questions / Re: [GLSL] How to make a gradient shader for background? on: 2014-07-11 08:28:35
You would be surprised how positively smooth textures and colours affect pixel art games. (At least from my experience, smooth simple 2d lighting is perfect for very simple pixel art games. It makes the game look very smooth or something. )
24  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:22:05
LWJGL has event methods built in Keyboard class.
25  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Proper Way to Handle GUI Input. on: 2014-07-09 16:11:44
If events are lost in the UI 'sometimes', the UI is not working properly.
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-09 14:35:24
My favourite ones are demon mage and farmer Cheesy
27  Game Development / Newbie & Debugging Questions / Re: For advice on where beginners should go to start making games on: 2014-07-07 07:57:38
This is what helped me make my first little game! Smiley

http://www.youtube.com/user/TheChernoProject
28  Discussions / General Discussions / Re: What kinds of experiences does everyone here have with 3d in Java? on: 2014-07-05 21:47:02
LWJGL
29  Game Development / Networking & Multiplayer / Re: [Kryonet] Server conecting problem! on: 2014-07-03 11:30:56
Some routers cannot 'reference' their own IP address (meaning you cannot connect to your own IP address). Ask a friend or someone on different network (different IP address) to try to connect to you.
30  Game Development / Newbie & Debugging Questions / Re: [Solved] Export a (libgdx) project to jar file with Eclipse on: 2014-07-03 07:39:35
You should try: Right Click Desktop project -> Export -> Pack required libraries into jar file.

Maybe eclipse does different things when doing File -> Export and Project -> Export, since the latter works for me.
Pages: [1] 2 3 ... 33
 

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

The first screenshot will be displayed as a thumbnail.

Riven (15 views)
2014-07-29 18:09:19

Riven (10 views)
2014-07-29 18:08:52

Dwinin (10 views)
2014-07-29 10:59:34

E.R. Fleming (28 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (40 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!