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
1  Game Development / Newbie & Debugging Questions / Re: LIbgdx: Tips on best practices for tilemap (Polygon?) collision detection on: 2014-07-25 21:20:56
Cool! This seems like a good way to do it.

And how would you set up the collision detection?
I'm not using box2D and not using bodies atm in my gameworld.

The way I am usually doing collision detection is keep track of player's x & u coordinates; & use that to set up a rectangle that will be used for collision detection.

I assume I should create a body and give it the dimensions of that same rectangle and then check if a body intersects with another body ??




Seems like you don't know to much about box2d. Do some research on it. It may look a little confusing at first but its quite simple to use specially if you are just needing collision detection.
2  Game Development / Newbie & Debugging Questions / Re: LIbgdx: Tips on best practices for tilemap (Polygon?) collision detection on: 2014-07-25 18:48:25
You can use box2d and create bodies with the polygon data from the object layer.

It is pretty simple, I managed to do it with this:

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  
27  
28  
29  
30  
31  
32  
public void loadBodies(MapLayer objects, Array<Body> bodies) {
      BodyDef def = new BodyDef();
      PolygonShape shape = new PolygonShape();

      for (MapObject object : objects.getObjects()) {
         if (object instanceof RectangleMapObject) {
            Rectangle rect = ((RectangleMapObject) object).getRectangle();

            def.position.x = (rect.x + rect.width / 2) / 10;
            def.position.y = (rect.y + rect.height / 2) / 10;
            def.type = BodyType.StaticBody;

            shape.setAsBox(rect.width / 2 / 10, rect.height / 2 / 10);

            bodies.add(world.createBody(def));
            bodies.get(bodies.size - 1).createFixture(shape, 0);
         }

         if (object instanceof PolylineMapObject) {
            float vertices[] = ((PolylineMapObject) object).getPolyline()
                  .getTransformedVertices();
            for (int x = 0; x < vertices.length; x++) {
               vertices[x] /= 10;
            }
            ChainShape shape2 = new ChainShape();
            shape2.createChain(vertices);
            def.position.set(0, 0);
            cuerpos.add(world.createBody(def));
            cuerpos.get(cuerpos.size - 1).createFixture(shape2, 0);
         }
      }
   }


This code works for rectangle objects and polyline objects. The divitions by 10 are there because for me 1 meter is equivalent to 10 pixels, but you can use any ratio you like.

Hope it helps you.
3  Games Center / WIP games, tools & toy projects / Re: The JGO Bar!!: SixtyGig - Open World Retro RPG. on: 2014-07-17 14:16:05
No more love for this project?  Huh
4  Game Development / Newbie & Debugging Questions / Re: Dropping items in in a stack on: 2014-07-16 05:13:09
1  
2  
3  
4  
5  
6  
7  
public void removeBottomBlock(){
arraylistOfBlocks.remove(0);

for(Block b:arraylistOfBlocks){
b-=blockHeight;
}
}


Something like that?
5  Java Game APIs & Engines / OpenGL Development / Re: [LibGDX] How on earth do I limit drawing to a certain area of the screen? on: 2014-07-16 02:03:23
LibGDX uses abstraction on its methods so layouts and jframes/panes wouldn't work on a mobile device I think.
6  Games Center / Showcase / Re: Perguntando [Wondering] on: 2014-07-12 07:33:40
Oh ok. I thought it was in spanish. Sorry.
7  Games Center / Showcase / Re: Perguntando [Wondering] on: 2014-07-12 05:38:40
Don't know if it's on purpose but it's "Preguntando" not "Perguntando"
8  Discussions / Miscellaneous Topics / Re: Remake a 3D famous game in 2D on: 2014-06-30 04:45:28
Ok, here's the deal.

I'll get a tablet in a few weeks. Will install a psx emu. Will play Silent Hill. And then (if I manage to get some time) will try my best to do a remake/demake.   Cool
9  Discussions / Miscellaneous Topics / Re: Remake a 3D famous game in 2D on: 2014-06-30 00:45:44
Could you provide a link please?
10  Discussions / Miscellaneous Topics / Re: Remake a 3D famous game in 2D on: 2014-06-29 21:51:07
The thing that I most want is a 2d remake of a 2d horror game
11  Discussions / Miscellaneous Topics / Re: Remake a 3D famous game in 2D on: 2014-06-29 21:45:39
WOW i didn't know there was a LD about remakes
12  Discussions / Miscellaneous Topics / Remake a 3D famous game in 2D on: 2014-06-29 21:40:45
Hi JGO.

It's been a while since the last time I wrote some code (life....) and I was thinking: "It would be cool if I had time to make a little 2D game. Probably a horror one. I GOT IT!!!! I'll make a 2D remake of Silent Hill 1"

Has there ever been 2d remakes of 3d games?

If so, do they have the "charm" of the original?

Wouldn't you like to play a top-down Resident Evil 4?

What are your thoughts about the topic?
13  Game Development / Newbie & Debugging Questions / Re: Problem fetching a Chip-8 opcode on: 2014-06-24 01:18:56
@burntpizza thank you that solve my problem.

Now i have another question: Why in every Chip-8 tutorial appears as
1  
memory[pc] << 8 | memory[pc+1]


Is there something different in how java manages bits?
14  Game Development / Newbie & Debugging Questions / Re: Problem fetching a Chip-8 opcode on: 2014-06-24 00:57:42
@liquidnitrogen Thank you, that actually worked  but for some reason the first opcode came wrong and the next in line came perfect.

Sadly if the first opcode is wrong the whole thing wont work.
15  Game Development / Newbie & Debugging Questions / [SOLVED] Problem fetching a Chip-8 opcode on: 2014-06-24 00:46:41
I'm really not sure if this is the right forum to ask this question, as this is not a game but an emu/interpreter but I'm freaking out over here.

Long story short:

I have to fetch the first two bytes from a byte array, which are A2 and CC (in hexadecimal of course).

For that task I do the following...

1  
int opcode = memory[pc] << 8 | memory[pc+1]


But instead of give me "A2CC" together it gives me "FFCC"

Please JGO I'm about to hang myself.

Thank you.
16  Game Development / Game Play & Game Design / Re: What's more expensive, a lot of if statements or pi? on: 2014-05-26 01:21:38
Dude, you REALLY need to learn some basic vector math...
17  Discussions / General Discussions / Re: [libGDX] How many cameras can I create? on: 2014-05-23 03:10:43
I really dont get why you would want to create several cameras for such a simple effect like parallax. Even if its not too heavy performance-wise, you would just over complicate your code.
18  Game Development / Newbie & Debugging Questions / Re: LibGDX Box2D Raycast problem on: 2014-05-16 16:19:36
Thanks but that's not the answer I'm looking for.

I already know how to use Raycast Callback. What I need is to know how to get the fixture that is closer to the origin of the ray.
19  Game Development / Newbie & Debugging Questions / LibGDX Box2D Raycast problem on: 2014-05-16 05:30:20
Hi, JGO.

I have a problem with Raycastcast Callback: When I return the fraction it does give me the closest hit point but not the closest fixture.

I need the closest fixture because I'm using rays as enemy "eyesight".

Hope you can help me.

Thanks in advance.
20  Games Center / WIP games, tools & toy projects / Re: The JGO Bar!!: SixtyGig - Open World Retro RPG. on: 2014-05-14 05:01:52
Quote
If you do include members in the game, make me a guy that gets shot. To death. With me dies the ultimate secret to fabulousness, and the game completely changes course from there, going to the main character trying to find a way to raise me from the dead. He will try many different methods, including Satanism and worshiping stuffed unicorns.

LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL
21  Games Center / WIP games, tools & toy projects / Re: [Slick2d] Retro-Pixels Castle Survival - Top Down Survival Mayhem! on: 2014-05-14 02:41:59
Quote
Self-made, it's based on a variation of my pathfinding system's search pattern, just instead of finding a path, it assigns a light level at all the places it checks. The distance it checks is based on how "bright" the light is. Wink

Do you really only have 1 year of experience as your profile says?

You do very cool stuff.
22  Games Center / WIP games, tools & toy projects / Re: [Slick2d] Retro-Pixels Castle Survival - Top Down Survival Mayhem! on: 2014-05-14 02:13:19
Lights!!! *-*

How did you do the dinamic lighting?

Library or self-made?

Any link you can provide?

Thanks  Cheesy
23  Games Center / WIP games, tools & toy projects / Re: The JGO Bar!!: SixtyGig - Open World Retro RPG. on: 2014-04-25 20:27:12
Dear Lord! I just just had an "eyegasm".

You have amazing skills in pixel art.
24  Game Development / Newbie & Debugging Questions / Re: [FIXED] Rotating animations problem in LibGDX on: 2014-04-25 20:22:17
How could I be so dumb?!

Thank you  Cheesy
25  Game Development / Newbie & Debugging Questions / Re: Rotating animations problem in LibGDX on: 2014-04-25 06:33:23
Pleaaaase I need to fix this for this weekend's ludum dare
26  Game Development / Newbie & Debugging Questions / [FIXED] Rotating animations problem in LibGDX on: 2014-04-25 01:01:35
Hello, JGO.

I'm trying to make a top down shooter with libgdx. As you already know, in a top down (Bird's eye) game, you don't need to make every side of a sprite because you just have to rotate the sprite and there is where my problem lies.

When you ARE NOT using animations you can just set the texture of the sprite
1  
sprite.setTexture(texture)
and then call the method
1  
sprite.setRotation(angleInRadians)
BUT I AM using animations so how can I get the texture when I'm calling
1  
animation.getKeyFrame(...)
.

Calling animation.getKeyFrame(...).getTexture() does not work as it returns the whole texture pack
27  Discussions / General Discussions / Re: Are there any artists on this forum? on: 2014-04-04 02:04:32
Acceptable? Those planets look very nice  Cheesy

Don't underestimate your abilities  Pointing
28  Games Center / WIP games, tools & toy projects / Re: NEW VIDEO: SixtyGig - Open World Retro RPG. on: 2014-04-04 01:57:36
Correct me if I'm wrong, but it seems like when your character moves diagonally, what you are doing is make him move at the same speed in the X and Y values.

To explain myself: If character moves to the right, you set his Xvelocity value to (let's say) 50, and if he moves up you set his Yvelocity to 50, but if he moves diagonally to right-up you set his X and Y velocity to 50 which doesn't make him move at 50 but at the square root of 50^2+50^2 which is 70.71, and that increase of speed makes his movement look kinda funny (at least in my opinion).
29  Games Center / WIP games, tools & toy projects / Re: SixtyGig - Open World Retro RPG. on: 2014-03-28 18:47:19
Rayvolution, you seem to be very good at pixel art. May I know what program do you use to paint? And, if possible, any tutorial link?
30  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX]Making a game work for desktop AND android? on: 2014-03-17 03:28:52
Start learning LibGDX for a couple of days and then you will realize that with a couple of "if" statements you can make the input work in any platform.
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.

CogWheelz (7 views)
2014-07-30 21:08:39

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

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

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

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

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

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

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

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

Riven (29 views)
2014-07-23 20:56:16
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!