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 (548)
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 ... 24
1  Discussions / General Discussions / No idea what to do... on: 2014-08-21 10:56:29
I have projects that I am working on and that, however I am stumped on what I should be learning at the moment.

I feel fairly comfortable with the language at the moment, I don't know every part of the Java API but when I discover something, I figure out how to use it fairly quickly.

So I am not sure what I want to learn at the moment, I have been using LibGDX for a year now but feel as if I can't do much that is impressive.

Like I want to learn how to do shadows, lighting and all that but not sure where to begin. Like for instance in Ray's Sixty Gig he has a cool blood particle effect, things like that.

Not sure what I should be learning...I was also considering completely revising Physics and brush up on fundamental Mathematics but trying to get the time to study that stuff is not as easy as learning something in terms of coding.

What direction should I be heading here, completely lost.
2  Game Development / Newbie & Debugging Questions / Re: [LibGDX]Trying to make Pong, weird ball behaviour, slides on wall? on: 2014-08-21 10:50:15
It is because the ball is overlapping and staying overlapped.

So therefore the code that resolves the collision is getting called repeatedly.

Have a search for Minimum Translation Distance or Minimum Translation Vector, this is what you will be looking for to do proper collision resolving using an easy algorithm.

EDIT: For more complex shapes, you can look up Separating Axis Theorom.
3  Game Development / Newbie & Debugging Questions / Re: Files wiped to null on: 2014-08-21 07:55:54
It takes literally 10-15 minutes to setup a repo and learn how to do the basics. Push every time you finish coding.

I see another one of these threads I am going to go insane.

EDIT: Wester Digital MyPassport harddrives start at around £40 and come with an automatic backup app, constantly copies over files that have changed. I haven't looked back.
4  Discussions / Miscellaneous Topics / Re: How often do you code on: 2014-08-19 11:47:42
Always. Coding is just problem solving and you tend to solve hard problems when you are doing something else.

Those sudden breakthroughs while taking a shower  Pointing

Nothing worse when you literally "dream" of a way to fix something, or implement something. You wake up and your link "OMFG IT'S THAT SIMPLE", then you fall back asleep and promise yourself you will remember that...

Ontopic : Very little as of lately, actually none. Working a lot and that but generally it is around 4-6 hours a day.
5  Discussions / Miscellaneous Topics / Re: Do you ever actually just despise someone ? on: 2014-08-19 09:11:57
I am a dick most of the time.

A constructive dick, get served a shit dinner? "That's shite, needs more xyz"
6  Game Development / Game Mechanics / Re: Getting into multi-threading. on: 2014-08-18 14:14:10
Only thing I have ever used multi-threading for was pathfinding, even at that my map was not really big enough to warrant a separate thread for iterating through the open list.
7  Game Development / Newbie & Debugging Questions / Re: Can someone teach me LWJGL 3D? or give me some good directions on: 2014-08-14 08:18:36
Everyone wants to make a game like mine craft.  Sad truth is that if you can't even go to the effort to use Google to answer this beaten to death question... You will fail.

Sorry to be the bad news bear.
8  Game Development / Newbie & Debugging Questions / Re: Lost my CODE! on: 2014-08-14 08:16:27
Source hosting is free... Like what is so difficult about taking 10 minutes to learn how to use it.
9  Games Center / Showcase / Re: Mario Skateboarding on: 2014-08-13 19:32:05
Note, I am not a lawyer so I can't give legal advise...

Look at the Patent act Gibbo posted, you are copying the "likeness" of the character, which is copyright. So, no you may not create a character that looks like mario and is named mario. You could change the name, but you have still copied the "likeness", that is illegal and you could be sued. If you change what the character looks like and keep his name and the name of your game as mario you could be sued, because that is also illegal, since Nintendo created the game called Mario.

Who knows, maybe Nintendo doesn't care if you use the character's likeness, just be aware that you're in a grey area which could cost you a lot of money.

What can be the worst thing that can happen to me ?  Grin
I'm just 17
Isn't just banning my google play account?

Your game ends up selling 50 million copies and your in the poor house before your 18.

Thing is, they won't care or even notice unless the game gains popularity. That is the grey area the above poster talks about Cheesy
10  Games Center / Showcase / Re: Mario Skateboarding on: 2014-08-13 18:45:41
Are you familiar with the Copyright, Designs and Patents Act 1988?...

Should be careful what you sell, especially when the character design does not belong to you.
11  Game Development / Game Play & Game Design / Re: Phone Controls for Desktop Game on: 2014-08-12 08:57:30
Sorry that sounds a bit negative Sad It's just the unfortunate truth.

You might also discover that the sorts of situations people find themselves in with mobile devices when playing games also don't really lend themselves well to traditional immersive style games at all too. People want to play games on mobile devices to distract themselves from short periods of boredom. They don't want particularly vexing challenges, certainly not ones that require them to concentrate hard, nor anything that requires even the remotest bit of learning controls.

Cas Smiley

What he is nicely trying to say, the majority of people that play games on their mobile phone are most likely on a short break from work, in bed when the missus won't put out or taking a huge shit on the toilet. They are also usually the lowest common denominator, they don't want to be challenged but they want to "feel" challenged. These people are usually at their happiest when they feel fulfilled, most of the time they go about with an undeserved sense of accomplishment anyway.

Make a game that rewards the player regardless of how trivial it is, make it shiny with lots of effects, controls should be bare minimum and easy to use and over all; the game should be easy enough to complete but hard enough to fail the first few tries.

Good luck with that.
12  Game Development / Game Play & Game Design / Re: Phone Controls for Desktop Game on: 2014-08-11 17:45:18
@thedanisaur

Offtopic : Ehhh, did I say that quote in your bio on here? lol
13  Game Development / Newbie & Debugging Questions / Re: Libgdx Android Crash Interact_across_users_full! on: 2014-07-31 08:15:48
Is your device rooted?

EDIT: To build on that, if your device is rooted that can cause this problem, commonly when you are trying to check if said device is rooted in code. However here is a short explanation to why you can't use that permission:

Stack Q
14  Game Development / Newbie & Debugging Questions / Re: [LibGdx]PPM conversion Error on: 2014-07-31 08:02:23
Everything works fine, I just don't get why the camera is 16,9 when I initialize it to be 16:9. What I mean:

1  
2  
camera = new OrthographicCamera(16, 9);
      camera.setToOrtho(false, 1000/ PPM, 1000/16*9/ PPM);


Am I doing somthing wrong here?

If you were not it would not crash, the reason you are crashing is because the scale is most likely tiny and causing inverted vetices.

So I'll explain what I mean, so lets create a camera:

1  
camera = new OrthographicCamera(16, 9);


Here we create a camera that is 16x9 meters. So you will be able to see 16x9 meters in the frustrum at any given time, you could go ahead and do 32x18, to allow a larger view or whatever, which is useful if you have say a platformer game and it has lots of enemies that are around 1.5-2 meters tall, it would appear very "zoomed in" at 16:9 but at 32x18 it will look further away.

What this basically does is, regardless of resolution of the device, the viewport will not change size and sprites will appear as the same size on everything. so a 200x200 sprite on a 1080p screen will have the exact same physical size on a 240p screen. So lets setup a scale:

1  
final float SCALE = 1/100f;


This means we are using 100 px = 1 meter.

So our 200x200 sprite, we want to create this and put it into our game world. Let's do that now:

1  
Sprite sprite = new Sprite(new Texture(Gdx.files.internal("SomeAwesomeSprite.png")));


If we try to draw this onto the screen with our current camera projection, all we will see is a bunch of super duper large pixels representing most likely a small portion of the bottom left corner of said sprite. We need to set the size of the sprite to match the scale:

1  
sprite.setSize(sprite.getWidth() * SCALE, sprite.getHeight() * SCALE);


Now our sprite is scaled down to size, you can draw it now properly.

Why I have picked 1/100f as a scale?

Your art needs to be consistant, it will make your life 100x easier if everything is to the same scale. At no point in your code should you be scaling down or scaling up your art, it should be made at the size it will be used in your game. So therefore when creating art we can always divide whatever pixel value we are using by 100 to get the world coordinates.

So a regular human character created at 50x100px would be 0.5m wide and 1m tall, he seems a little short and fat no? A more realistic sprite size would be 25x180px, 0.25m wide and 1.8m tall, that is a little closer to the average height of a human.

This is with a realistic human though, those are boring but you get the point.

Of course this is with an easy, non resizing viewport (which imo is better 90% of the time anyway).

Doing this will also allow you to stick to Box2D's rules, having things as close to the size of the real thing as possible for optimal performance. If you have a Player and a Bus, they should be drawn in proportion relative to each other.
15  Game Development / Newbie & Debugging Questions / Re: [LibGdx]PPM conversion Error on: 2014-07-30 19:31:21
Post the native output error from the console.

Also your whole PPM conversion is overly complicated.

To keep things simple, use a fixed viewport like so:

1  
camera = new OrthographicCamera(16, 9);


^ This here will set the viewport to 16x9 meters, which is obviously a 16:9 ratio.

Then you pick a scale, such as 1/100f. Then you can multiply any pixel values to convert them to meter values.

EDIT:

I suspect you have this error -

1  
2  
3  
4  
5  
6  
7  
AL lib: (EE) alc_cleanup: 1 device not closed
Assertion failed!

Program: A:\Java 7\bin\javaw.exe
File: /var/lib/jenkins/workspace/libgdx/gdx/jni/Box2D/Collision/Shapes/b2PolygonShape.cpp, Line 397

Expression: area > 1.19209289550781250000e-7F


This means your shape is far to small and the vertices are reversed and it can only be creating, I believe counter clock wise.
16  Game Development / Newbie & Debugging Questions / Re: StateMachine, Java Generics issue on: 2014-07-29 13:17:40
Why not using Fettle API?
https://github.com/thehiflyer/Fettle

Never actually heard of that, I created the one I have atm for simplicity as it took maybe, 15 minutes to write.
17  Game Development / Newbie & Debugging Questions / Re: Voxel Destroy Item on: 2014-07-29 09:48:09
Yeah you are right this is a 3d Game. I have blocks being destroyed correctly and working but I want to get the pickaxe to be removed from the game and my inventory when it's life runs out.


Ehhhhhhhhh, you managed to do that but you can't add a simple durability component to the pickaxe then remove it from the players inventory and chuck it to the side for the GC?...am I missing something here? lol
18  Game Development / Newbie & Debugging Questions / Re: How do I make biomes in a 2d array game (tiles) on: 2014-07-29 09:44:00
quick question do you know how to do it?

Honestly a quick Google will flood you with guides on how to do it.

I shall look at it. I do know java but forgot 1 thing because i dont use them

If you don't use Lists then you don't know Java, they are very important for game development, programming in general really.
19  Game Development / Newbie & Debugging Questions / StateMachine, Java Generics issue on: 2014-07-29 09:29:21
I am having a little bit of an issue here and it is possible due to me being new to using Java generics, I have a StateMachine class and State interface that use generics, since I coded them to be used with anything that requires state handling.

So my State interface looks like 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  
public interface State<T> {

   /**
    * Called when the {@link StateMachine} changes to this state
    *
    * @param object
    */

   void enter(T object);

   /**
    * Called in the {@link StateMachine} update method, the actual state should
    * be updated in here
    *
    * @param object
    */

   void execute(T object);

   /**
    * Called when the {@link StateMachine} changes to another state
    *
    * @param object
    */

   void exit(T object);

}


Very straight forward, so a user can implement their own states, something like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
public class TestState implements State<Player> {

   @Override
   public void enter(Player arg0) {
     
   }

   @Override
   public void execute(Player arg0) {
     
   }

   @Override
   public void exit(Player arg0) {
     
   }

}


Now the problem is, I have the StateMachine with fields like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
   /**
    * The default {@link State}, should be set to the Objects default
    * {@link State} to avoid a stateless object
    */

   State defaultState;

   /**
    * The current {@link State} the object is in, this state will be executed
    * in the StateMachines update method
    */

   State currentState;

   /**
    * The previous {@link State}, when the Objects {@link State} is changed,
    * the one that was set before is automatically put in this variable
    */

   State previousState;


Which flags a whole lot of yellow, as I am not using generic arguments. Now any one of those states could be of any type, so how should I go about this?

My first thought would be using <?> since technically the type is unknown at this time, but that does not seem to be the solution. After reading through the Oracle tutorials I can't seem to figure out how to approach this.

I could leave it all flagged yellow, it still works but it looks horrid with a ton of suppress warning annotations.

Baring in mind I also have a bunch of methods that alter these State fields, such as this :

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 changeState(State newState) {
      /* If the StateMachine is locked, can't change State */
      if (isLocked)
         return;
      /*
       * If the newState is the same as the currentState, no point in
       * continuing
       */

      if (newState == currentState)
         return;
      /* Set the previous state to the current state */
      previousState = currentState;
      /* If the current state is not null, we call its exit method */
      if (currentState != null)
         currentState.exit(owner);

      /* Set the current state to the new state */
      currentState = newState;

      /* If the current state is not null, enter it */
      if (currentState != null)
         currentState.enter(owner);
   }


What kind of generic argument should I be using for method parameters? I am not sure at all.
20  Game Development / Newbie & Debugging Questions / Re: How do I make biomes in a 2d array game (tiles) on: 2014-07-28 08:58:21
I want to make biomes in my game how would i do that?
I want to make 2 biomes at the moment (Grass and sand)
if you would like source code please inform me please thanks

Also the tiles are rendered in a 2d array

Very vague question
Ok, fair enough
That would be a start, you don't go to a car mechanic and don't bring the car

It seems you need to take a step back and learn basic Java before diving any further, or you will drown.
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-08 08:50:29
Hmmm, does not seem to with LibGDX Array.
That's because LibGDX's developers took care if this issue, but with Java's built-in collections you can not modify a collection while you're iterating over it using a for-each loop.

To the OP: Use ListIterators. They can both remove and add elements to the collection during iteration. Smiley

So why is the OP using an ArrayList and not an Array<?>....

22  Game Development / Newbie & Debugging Questions / Re: Should I move to LibGDX? on: 2014-07-07 22:20:09
You can set the camera to be y-down like you're used to by calling
camera.setToOrtho(true);


Or just simply deal with it. Any snippets you find using LibGDX will be using y-up, so you might just end up confusing yourself.

Especially when it comes to fonts.
23  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-07 17:22:03
@Gibbo If I'm not mistaken, that'll throw a ConcurrentModificationException

Hmmm, does not seem to with LibGDX Array.

For instance in my breakout game I am iterating through the Array of Blocks, to check if Ball overlaps a Block, if so remove from array. It gets removed during iteration.
24  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-07 14:04:09
ehhhh...


1  
2  
3  
4  
5  
    for(Thing thing: aListOfThings){
        thing.update();
        if(thing.hasDoneSomethingBad)
            aListOfThings.remove(thing, true);
}


Unless I am missing something here?
25  Game Development / Newbie & Debugging Questions / Re: Should JGO have a JGO Store? on: 2014-07-07 13:54:10
This would also require maintenance + extra security. Riven has enough things to deal with.
26  Game Development / Newbie & Debugging Questions / Minimal Translation Distance too short? on: 2014-07-07 13:17:32
I am having a little bit of trouble using an MTD formula for basic AABB collision detection.

The problem being is that the moving object collides with a static object, it should respond by "bouncing off" in the correct direction, so depending on the value of X or Y, I reverse the respected velocity of the moving object.

So I have a Ball and a Block, ball hits block > block gets deleted and ball bounces fine

However if ball hits a block and block say has, 3 health and requires 3 hits...the ball will collide with it constantly until it no longer exists. If that makes sense?

Basically this here:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
Vector2 mtd;
if (ball.getBounds().overlaps(block.getBounds())) {
               mtd = ball.getBounds().getMinimumTranslation(
                     block.getBounds());
               ball.getPos().add(mtd);
               if (mtd.x != 0) {
                  ball.velocity.x = -(ball.velocity.x * ball
                        .getFriction());
               } else if (mtd.y != 0) {
                  ball.velocity.y = -(ball.velocity.y * ball
                        .getRestitution());

               }
               notify(block, Event.BLOCK_COLLISION);
            }


The value of MTD is so small that it can not resolve the collision properly, so adding it to the current ball position does not move it out of the bounds of said block.

What can I do to stop this?

Here is the MTD method:

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  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
public Vector2 getMinimumTranslation(BoundingBox other) {

      /* The collision vector */
      Vector2 mtd = new Vector2();

      /* The left side of the AABB */
      float right = (other.getX() + other.getWidth()) - this.getX();
      /* The right side of the AABB */
      float left = other.getX() - (this.getX() + this.getWidth());
      /* The top side of the AABB */
      float top = (other.getY() + other.getHeight()) - this.getY();
      /* The bottom side of the AABB */
      float bottom = other.getY() - (this.getY() + this.getHeight());

      /* If right is less than left, we collided left */
      if (Math.abs(left) < Math.abs(right)) {
         mtd.x = left;
      } else {
         /* Else we collided right */
         mtd.x = right;
      }

      /* If top is less than bottom, we collided top */
      if (Math.abs(top) < Math.abs(bottom)) {
         mtd.y = top;
      } else {
         /* Else we collided bottom */
         mtd.y = bottom;
      }

      /*
       * See which component of our collision vector is smallest
       */

      if (Math.abs(mtd.x) < Math.abs(mtd.y)) {
         mtd.y = 0;
      } else {
         mtd.x = 0;
      }

      /* Return our collision vector */
      return mtd;

   }
27  Game Development / Newbie & Debugging Questions / Re: For advice on where beginners should go to start making games on: 2014-07-07 12:43:39
Watch all these:
https://buckysroom.org/videos.php?cat=31

Then these:
https://buckysroom.org/videos.php?cat=25

..and eventually these:
https://buckysroom.org/videos.php?cat=30

..and bonus: These if you're interested in using slick2d (I recommend LibGDX though, it's more up to date)
https://buckysroom.org/videos.php?cat=54

If you watch all of those (at least the first two links) you'll have a pretty solid groundwork of java fundamentals. It doesn't cover everything, but it does knock out a huge amount of basics.

Just had a fly over these, short and concise videos. I watched a few of them, stuff I knew but still.

Edit: Oh and yeah, he breaks quite a few Java formatting rules but meh.
28  Discussions / Miscellaneous Topics / Re: Back on the bike on: 2014-06-30 09:30:14
No mountain-biking for me, I prefer riding road bikes Smiley

The seat (saddle?) isn't my problem, since because of the handlebar being very low, I mostly put my weight on my arms and legs and only a little on the seat.

Do that on a mountain bike and enjoy your snapped arms first rock :p

I bike to my classes here in downtown Atlanta. I love it, and hopefully I won't get hit my a car anytime soon Smiley

Chicks dig scars Wink
29  Games Center / WIP games, tools & toy projects / Re: Zombie Nauts [0.4.5] on: 2014-06-27 10:24:03
I've lost absolutely all inspiration. It sucks because I really wanted to finish this game but I can't bring myself to do it. Can someone help me find some drive?

Finish it or I will kill your family while you sleep.

There, sorted.

Seriously though, finish it :p
30  Discussions / Miscellaneous Topics / Re: Get to Work on: 2014-06-26 08:01:57
You !don't deserve my medal.

Just...stop. Please think of the children.
Pages: [1] 2 3 ... 24
 

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 (27 views)
2014-08-19 09:29:53

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

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

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

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

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

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

BurntPizza (31 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!