Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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 ... 39
1  Discussions / Miscellaneous Topics / I have not programmed in 3 weeks. on: 2015-06-24 11:55:08
And counting. I recently got a new job and it is working 0830 to 1900 7 days a week, I have literally no spare time and any spare time I do get, I spend it with my partner.

I am getting put onto 6 days a week soon, with a day of my choice off at the start of every week. How on earth do you guys juggle stuff around work hours? It's slowly killing me but I need the cash, I can't even look for programming work because I am don't have time when I get home.

I feel shit for not coding, I really want to code but just don't have the time. Does this happen to many of you? How do you handle it?
2  Games Center / WIP games, tools & toy projects / Re: Space Grunts - turn-based/action roguelike on: 2015-06-01 18:31:08
Very nice indeed, you are very skilled and I love your art style Cheesy.

Are you planning on adding lighting effects to spruce it up?
3  Discussions / Miscellaneous Topics / Re: What is your opinion about ... on: 2015-06-01 18:07:58
I also use system print quite a lot, but mine is tucked away in a Logger class so I can disable messages without having to look through them all and comment them out. I use a hashmap that has name as key and boolean as value, I then print using the respected debugging type and can disable whatever ones I don't want.

If that makes sense lol. Allows me to say, disable debugging for asset loading but enable it for character generation, without changing any lines.
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-31 07:08:28
Hmm, it's a Google AdSense ad, so I cannot report it to ProjectWonderful, as is. Emo

The previously reported (by you) ads have been reported (by me) to ProjectWonderful and those advertisers have been banned/punished/murdered in quick succession, as per my request.

I probably missed a part of the conversation. but what exactly is the problem with those ads? it looks legit. The only not legit  thing about it maybe is the girl's butt. And maybe some people here do want to get a girlfriend ... so it's a well targeted ad.

Mostly to do with this being a family friendly website, face it, click that ad and see it's just a website for swingers . You don't see these ads on other forms.
5  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-31 07:05:19
You are free to implement that class into your project, don't worry about how it works, hell I'm still learning matrices lol.

Oh, okay Grin

For this to work, I need to create some sort of 'joint' for the hand, correct? As I need to tell the weapon where to connect to. This would still mean having to move the joint manually for each frame of the animation and then this math would move the weapon for me

Depends how you are doing it, how I would be to have the character know where is hand is (via joint, Mount or something). Then have the weapon know where it should be held using a similar system. If your animation moves these points visually then yes, you will need to have some sort of system that moves the joints each frame and also reassigns the transform position.

Alternatively, you could also give the joint a transform, parent that to the character, then parent the item to the joint. Structured correctly, the joint can easily be updated to match the characters state and animation, and the weapon will move accordingly.
6  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-30 07:09:49
Thank you, Gibbo Grin

I don't think I know enough about matrices/this type of math at the moment so i'm going to go the cheating route for this game (The built in assets method). I know how to add/multiple matrices but i've never dealt with them in LibGDX/games so it's a bit overwhelming.

You are free to implement that class into your project, don't worry about how it works, hell I'm still learning matrices lol.
7  Discussions / General Discussions / Re: How many projects do you go through? on: 2015-05-29 09:01:01
I have a folder called Graveyard that has around 100 sub folders...
8  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-29 06:55:37
Didn't want to just hand out a solution until you had multiple input, but here is pretty much what I use.

A member of JumpButton Studios helped me understand this, I now use it for everything, I even wrote it in C# and C++ it was that damn useful.

You can use it if you wish, this is the basic version that just parents everything, written in Java :

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  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
import com.badlogic.gdx.math.Affine2;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;

/**
 * Represents the data for the position, scale, angle and origin
 *
 * @author Stephen Gibson
 */

public class Transform {

   public static Quaternion ZERO_ROTATION = new Quaternion();
   public static Matrix4 ZERO_TRANSFORM = new Matrix4();
   public static Vector3 VECTOR_ZERO = new Vector3();
   public static Vector3 VECTOR_ONE = new Vector3(1, 1, 1);

   // The transform that is parented to this transform, for relative position,
   // scale and rotation
   protected Transform parent;
   public Vector3 position = new Vector3();
   public Vector3 scale = new Vector3(1, 1, 1);
   public Quaternion rotation = new Quaternion();
   
   // Scale and rotation matrix
   public Matrix4 model = new Matrix4();
   public Matrix4 transform = new Matrix4();

   /**
    * Sets the parent of this transform, this transform won't be updated until the next step
    * @param parent
    */

   public void setParent(Transform parent){
      this.parent = parent;
   }
   
   public Matrix4 getParentTransform(){
      if(parent != null)
         return parent.getTransform();
      return ZERO_TRANSFORM;
   }
   
   public Quaternion getParentRotation(){
         if(parent != null)
            return parent.getRotation();
         return ZERO_ROTATION;
   }
   
   public Vector3 getParentScale(){
      if(parent != null)
         return parent.getScale();
      return VECTOR_ONE;
   }
   
   public Matrix4 getModelMatrix(){
      model.idt();
      model.scl(scale);
      model.rotate(rotation);
      return model;
   }
   
   public Matrix4 getTransform(){
      transform.idt();
      transform.mul(getParentTransform());
      transform.translate(position);
      transform.mul(getModelMatrix());
      return transform;
   }
   
   /**
    * Gets the position relative to the parent
    * @return
    */

   public Vector3 getPosition(){
      return position.cpy().mul(getParentTransform());
   }
   
   /**
    * Gets the absolute position
    * @return
    */

   public Vector3 getLocalPosition(){
      return position;
   }
   
   /**
    * Get the scale relative to the parent
    * @return
    */

   public Vector3 getScale(){
      Vector3 scl = parent == null ? VECTOR_ONE : parent.getScale();
      return scale.cpy().scl(scl.x, scl.y, scl.z);
   }
   
   /**
    * Get the rotation relative to the parent
    * @return
    */

   public Quaternion getRotation(){
      return rotation.cpy().mul(getParentRotation());
   }
   
   public void setPosition(Vector2 position){
      this.position.set(position, 1 );
   }
   
   public void setScale(Vector2 scale){
      this.scale.set(scale, 1);
   }
   
   public void setRotation(Quaternion rotation){
      this.rotation = rotation;
   }
   
   public void setAngleAxis(float x, float y, float z, float degrees){
      rotation.setFromAxis(x, y, z, degrees);
   }
}


This version here, although not written in Java, allows you to choose what part of the transform to parent. Should be easy to duplicate LINK
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-28 10:59:27
Trying to find a girlfriend apparently:

10  Games Center / Showcase / Re: Heroes of Loot's Steam release on: 2015-05-27 12:56:07
Nice looking game, also very reasonable price point as well. Good job.
11  Discussions / General Discussions / Re: Rayvolution's JGO Appreciation Thread (AKA: Free copies of Retro-Pixel Castles!) on: 2015-05-27 10:47:53
I would love to give the game a try.
12  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-26 18:42:39
So take these into account before doing it the cheat way lol.

So is your way the standard way of doing this type of item placement? I mainly plan on only using the assets for the player but it would be cool is something like a skeleton used the same weapons.

Would you not have to redesign the assets for bigger mobs anyway Huh

Parenting transforms is a pretty standard way of positioning things relative to other things, regardless of what it is. If say a skeleton was to pick up a bow on the ground, the skeleton would know where about it should hold that particular item.

You would not have to redesign the assets for a bigger mob. Why should a dagger be bigger for a 10ft orc type mob as opposed to a 6ft hero? A dagger is a dagger, if the orcs have their own weapons then of course, you would have to make more assets, as opposed to redesigning existing ones.

If you are making a game, where anybody can pick up anything, then yes; this is a pretty standard way.
13  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-26 12:17:41
Gibbo's solution does seem neat Smiley

Cheers  Wink.

Jacobs solution is also viable as long as the art is not to be used by things off varying sizes. If you want to allow say a large orc to use the same dagger as the player, and the player happens to be half the size...well, you just doubled your asset count. Say you wanted to use the same sprite for the UI and pickups , it's now triple the amount of assets.

So take these into account before doing it the cheat way lol.
14  Discussions / General Discussions / Re: Teaching Kids to be Independent on: 2015-05-22 05:58:02
It's the harsh reality that kids are "stupid", but what age group are you talking about in particular?

I tried (note tried) to teach basic java to a group of around  15 youths, these particular youths were early school leavers that claimed they wanted to do something computer related, quite a lot of them had an interest in programming, some hardware and the odd one or two that wanted to go to college and do games development.

What a waste of time for me and the organisation. We made a few little games (rock paper scissors, tic tac toe etc), as well as basic programs that simulate bank accounts.

Half of them left because they could not be bothered to show up, the others, whenever they got stuck they would go on Facebook or some random reddit page until I noticed, then asked for help.

Turned out this was pretty common, happened with every group and I was not the first person to try.

However, there was one girl in particular that loved to be creative, she wanted to do games design and possibly programming. I put most of my attention into her, helped her as much as possible.

I gave her a road map that could get her from where she is, and onto a course that is meaningful. Told her what she needed to learn and what to expect.

She is now doing the course I did 2 years ago.

All the other kids wanted to do was go home and play games on the xbox, their parents literally just let then do f**k all with their lives.

Quite the opposite end of the spectrum, on my end the parents did not care and unfortunately, the kids will never excel in anything. In your end, the parents are pushy and controlling, so the kids will succeed but still never excel in anything.

So yeah, tldr kids are shit, just do your best and try to find the ones among the idiots and focus on them. Diamond in the rough and what not.
15  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 21:25:51
Yeah this is the exact same, as long as you have your sprite origin set to the middle, it should be fine.

If it is offset in anyway, it will pivot weird.

Position before rotation as well (if you are doing some sort of get order).
16  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 20:32:34
That's what I was looking for! Thank you. Do you have any advice for what to do then when I rotate the sprites?

Pretty much the exact same, just replace position with angle/rotation  Wink.
17  Game Development / Newbie & Debugging Questions / Re: LibGDX Draw item in players hand (2D top down view) on: 2015-05-20 11:08:39
Use a parent child setup.

So the position of the character is say, 5x5. And the item should be placed in their right hand. So lets say the sprite is facing directly right (zero degrees).

The item should be positioned 1 unit offset on the y axis. So if you were to write both positions separate, it would be 5x5 for the player and 5x6 for the item.

Now if you were to parent them (or their transforms), then you would have it be 5x5 for player and 0x1 for the item.

Here is some pseudo:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
// New character at position 5, 5
Character c = new Character(5, 5);

// Give the character an item, at position 0, 1
Item i = new Item(0, 1);

// Now parent them
i.setParent(c);

// Now the get position method would look something like this
public Vector2 getPosition(){
    return parent == null ? position : position.add(parent.getPosition());
}

// Draw each of them
// This will draw the item at the position of the parent, then at it's own position
batch.draw(i.sprite, i.getPosition());
// This will just draw the character, if it had a parent it would draw it at its parents position + its own position
batch.draw(c.sprite, i.getPosition());


This would be best split up into transforms of course, as you don't want to tie objects together like this.

18  Games Center / WIP games, tools & toy projects / Re: Flying Cavemen - Inifinite Scroller [LibGDX] on: 2015-05-17 14:55:56
This is by no means a bad game, but the performance is pretty terrible.

It is fun though, attention to detail is striking as well.
19  Discussions / General Discussions / Re: What's your day job? on: 2015-05-11 08:54:55
Just started a new job few weeks ago, in a local bike shop.

Learning a lot, great fun and most important, cheap components! Cheesy.
20  Game Development / Newbie & Debugging Questions / Re: How to order the way in which objects are rendered? on: 2015-05-06 11:31:21
Just to build on what Riven and Cero said.

You sort by layer, which means sorting each frame will take literally no time at all.

You may have a list of layers that contain a list of items, spanning many thousands. The internal array is never sorted, only the layer list is sorted.

So think of a layer as a data structure for render able objects, so to say.
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] Where to start? on: 2015-05-06 11:19:57
If you have been working with Slick for 3 years then have no fear, the LibGDX documentation is HERE.

You should have no issue at all getting to know the API.
22  Game Development / Newbie & Debugging Questions / Re: [LibGdx] Best way to handle textures for hundreds of objects? on: 2015-04-28 15:54:00
Use the AssetManager supplied with the LibGDX library. Load textures once, use Sprites with them for multiple draw transforms.

Do not put the textures into a class and declare them all static, this is a bad habit and you will suffer from OpenGL context lost on the Android platform.

Here is the wiki for it.
23  Discussions / Miscellaneous Topics / Re: Can Word Lists be Copyrighted on: 2015-04-22 11:48:53
You can not copyright words or numbers.

Oh, but you can copyright numbers. And people do all the time. Every time a bit of code is copyrighted, they are essentially just copyrighting a very large number, as it's essentily nothing but a string of 0s and 1s. You can also trademark numbers for specific uses, such as Boeing and their 737.

I was meaning that you can't directly copyright a single number or word lol.
24  Game Development / Newbie & Debugging Questions / Re: how to fit a body to a sprite avoiding transparent space? on: 2015-04-18 20:10:45
i destroy the fixture to create a new one every frame with the new size

Don't do that, if your character changes size dynamically, simply attach fixtures to represent the larger sizes and set them as sensors.

Say the player can shrink to half his size, have 2 fixtures. 1 for normal size and 1 for half size that is a sensor but default, whenever the player shrinks, set the full size one to sensor and the half size one to not sensor.

Creating a new fixture every frame is a waste of power, especially if you are doing it for more than 1 entity.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-11 21:43:11
Started my new job at a local bike shop called the bike smith, woot.

Good bunch of guys, good laugh, trade prices on stuff :p.
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-07 18:25:48
Bit the bullet, bought one of these. 8 weeks and the red one will be in stock and in my garage next day Cheesy.

Yay



I regret nothing.
27  Game Development / Newbie & Debugging Questions / Re: [libGDX] Make Tiled cell/tile transparent with code on: 2015-04-04 07:18:49
I guess the cell is a texture. Any way i can change the alpha of a texture?

You could use a simple shader, as that is basically what the sprite alpha and color altering methods are doing.

It would not take long to switch over to Sprite as opposed to texture, it's going to be easier and faster than doing it yourself.
28  Game Development / Newbie & Debugging Questions / Re: [libGDX] Make Tiled cell/tile transparent with code on: 2015-04-03 20:43:07
The Sprite class allows you to directly change the alpha amount.

I believe it is :

1  
2  
Sprite sprite = new Sprite() ;
sprite.setAlpha(someValue) ;
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-03 11:43:36
I've been working on a project that was shelved back in November, I am doing a refactor and update on it and I was quite curious to just how flexible the Entity and Component code was.

So I made a new playable character that was literally a cloud, I was entertained for a whole 30 minutes just building playable objects.
30  Discussions / General Discussions / Re: Looking for a developer on: 2015-04-03 06:37:19
I appreciate the op. Kev, as per usual had dimmed in on this with the exact same (good) advice he gives every other thread like this.

The difference? The op didn't go full asshole and throw it back in his face.
Pages: [1] 2 3 ... 39
 
SHC (28 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (22 views)
2015-07-27 15:35:20

Riven (25 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21
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!