Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  Game Development / Newbie & Debugging Questions / Re: LibGDX - Screen states issue on: 2014-09-29 16:17:54
Try to put some effort into describing your problem. For example, tell us:
  • what is the error that you see? any stack trace?
  • what library do you use for your GUI? Scene2D UI or something else?
  • show us some code you think the problem may lie in (in code tags: [ code ] ... [ / code ] for readability)
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: How to install Eclipse on: 2014-09-29 16:14:58
Or:
3  Game Development / Game Mechanics / Re: Moddius - A simple Modloader compatible with ANY Java game! (15+ Downloads!) on: 2014-09-29 14:52:56
Interesting idea. However, I have a hard time understanding how this will be useful. What does it do?

I mean, it's not terribly hard to add a jar to a classpath:
1  
java -cp game.jar;mods.jar ...


How does your mod loader help with this?
4  Game Development / Game Mechanics / Re: Issues with gravity on: 2014-09-29 14:49:49
You can always "cheat" and simply place a limit on maximum speed. I believe practically all physics simulations do this to avoid problems like the one you mentioned.
5  Game Development / Newbie & Debugging Questions / Re: LibGDX - Fade In problem on: 2014-09-29 14:14:20
if(fadeIn == true) alpha = (float) (alpha + 0.02);
if(alpha == 1) alpha = 1;

There are some big errors in this code. Here's what I suppose you wanted to do:
1  
2  
3  
4  
5  
6  
if(fadeIn) {   // no need to write == true 
  alpha = (float) (alpha + 0.02 * delta);      // you need to factor in delta time since last frame or your fade will be different on faster/slower computers
}
if(alpha > 1) {  // better check for > 1 because == 1 will nearly always fail
  alpha = 1;
}


Try to copy-paste your code next time, and use code tags ([ code ] ... [ / code ]). It makes your code easier to read and helps us find the cause of the problem.

Good luck!
6  Game Development / Newbie & Debugging Questions / Re: LibGDX - Coordinate Issue with Gdx.input.istouched on: 2014-09-29 14:07:16
When I run my game on the desktop, if I click a rectangle it works.. however on the android, the rectangle is in a different position, yet the img is normal.

I don't get the question. What rectangle do you click, and how does that rectangle relate to "the" img? If you want help put some effort in explaining what the question is, because this does not make sense.
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-28 19:56:37
Well, I haven't completely figured it out yet, but so far I have in mind a cross between homeworld, tetris, FTL and Star Control. Save the galaxy in roguelike style using your spaceship built out of collected tetris-like parts. Something like that..

Anyway I gotta go to bed, work tomorrow!
8  Game Development / Newbie & Debugging Questions / Re: Image flickering when moved (slick2d) on: 2014-09-28 19:43:44
Showing us some rendering code may help us identify the problem.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-28 19:42:27
Got started with a spaceship part editor. The parts will be built from blocks using this tool. The player will eventually combine the parts into a spaceship and save the galaxy with it.
10  Game Development / Newbie & Debugging Questions / Re: LibGDX - How to achieve movement trail effects on: 2014-09-28 10:44:02
use a semi-transparent color to clear the screen with each frame

Genius! I never thought of doing that, but sounds like an aweome effect.
11  Discussions / General Discussions / Re: Why are people jerks? on: 2014-09-28 10:41:24
Also, I was thinking of this XKCD when reading this topic:


I must admit I have been an asshole on the internet plenty of times because of this. But fortunately I grow a little bit wiser over time..
12  Game Development / Newbie & Debugging Questions / Re: LibGDX - What is the best way to handle menu touch input? on: 2014-09-26 20:22:46
The "skin" defines how your GUI will look. It's basically a set of images and one or more fonts and a JSON (text) file that defined what image and what font is used to render the different GUI elements.

Setting up a skin may look somewhat overcomplicated, but as soon as you move beyond simple things like a menu with a few buttons, it starts to become a real timesaver.

Here's a tutorial / info on Skins: https://github.com/libgdx/libgdx/wiki/Skin

You can get started quickly by using an existing skin instead of making your own. For example, you can use the skin used by the LibGDX samples. You can find here how to do that: http://stackoverflow.com/questions/16182844/default-skin-libgdx.

Good luck!

Edit: so basically you have to do the following:
1. Setup skin files (images, fonts, skin JSON) and load it in your game
2. Create an ImageButton with your texture and the skin you loaded
3. Done
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-26 18:12:42
Drew some more tiles for a 2d-ship design kind of game I'm working on.
14  Discussions / General Discussions / Re: Why are people jerks? on: 2014-09-26 18:11:25
Don't agree with Cas and some other people who got like converted from this video

Did you bother to watch it? It's actually quite interesting and does not discuss whether the guy is an asshole or not.

Now, him being in the gaming indie public eye generates way more hate and anger than it would normally.
However if you say, sounding serious, "all japanese games are garbage" in front of like 20 people. I guess 9 will call you out and 5 will call you names.
if you do it on the internet its just more people.

I'd hardly expect the audience to start making death threats to him or his family, do you? Or would you consider this a proportionate response to someone giving his - asked for - opinion on some computer games in a somewhat blunt way?

He simply doesnt know how to interact with people. A person should be friendly and polite, especially to strangers and especially in front of a huge audience, none of which you know personally.

Self-criticism is difficult, isn't it? Your last sentence made me laugh. Here is you, Cero, posting on the internet, while preaching that you should always be friendly and polite, for all the world to see "Phil Fish is an asshole. The end." Does that not strike you the least bit as ironic?
15  Game Development / Newbie & Debugging Questions / Re: LibGDX - What is the best way to handle menu touch input? on: 2014-09-26 08:45:57
In LibGDX you are best off using the Scene2D UI framework for building your menus. It's a great framework and if you hack something yourself it will in most cases be inferior to the Scene2D way of doing things.

As mentioned earlier, there's some simple examples in the LibGDX docs:
https://github.com/libgdx/libgdx/wiki/Scene2d.ui

The idea here is that you put e.g. a Button actor on the screen, and then attach a listener to it that is triggered when the button is clicked:
1  
2  
3  
4  
5  
button.addListener(new ChangeListener() {
    public void changed (ChangeEvent event, Actor actor) {
        System.out.println("woohoo, button click!");
    }
});


This tutorial goes into making a simple menu, which seems ok:
http://www.toxsickproductions.com/libgdx/libgdx-basics-create-a-simple-menu/
16  Discussions / General Discussions / Re: Why are people jerks? on: 2014-09-26 08:35:55
Compassion is always a good thing to feel.

Very interesting video by the way. It goes into the "systemic" (dunno the right word) aspect of this. Yeah, "people" are awful, but the same "people" that hate on the interwebz may be great neighbours, fathers, colleagues or just someone nice that helps you with a smile when you drop your groceries.  I doubt we should wait for "people" to improve. Humans are humans with human strengths and weaknesses, they won't change.

It's the context or the system in which people are situated which brings out the worst or the best in people (as in the herd, not in individuals per se). Improve the system or the context and people's behaviour improves. That's clearly visible here on JGO, where with some wise moderation and reputation to be maintained discussion is overall very friendly.

The wild, "free" and anonymous internet is overall a horrible place due to a lack of systems that help people behave nicely. Freedom is relative.
17  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-24 16:34:31
Because Grunn is the local name for the town I live in, and because of this:
<a href="http://www.youtube.com/v/cuHOzHHC7ms?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/cuHOzHHC7ms?version=3&amp;hl=en_US&amp;start=</a>  Pointing best unit sounds ever!
18  Discussions / General Discussions / Re: Why are people jerks? on: 2014-09-24 06:09:14
As for Cas: man I loved your tirade.  Reading it, I was getting pissed off part way through, but I got your point in the end and it certainly did make for a perception shift as your point about the worth of individual customers sank in. 

Agreed, it's a pleasure to read Cas's writings!
19  Discussions / General Discussions / Re: Why are people jerks? on: 2014-09-24 06:03:48
Few humans have internalized values that would prevent them from acting in a nasty way to others if there were no consequences attached.

Most humans need some form of social or legal control to function decently towards other. In any situation where social control breaks down (e.g. war, anarchy, the anonymous interwebs) large groups of humans turn into violent mindless beasts. See any war situation in the past centuries and any situation in which one human gets too much power over other humans (e.g. child abuse, sects, police brutality).

The positive side in all this is that somehow we as a species manage to put systems into place (democracy, justice, ...) that helps control human behaviour and make us generally act nice to each other.
20  Game Development / Shared Code / Re: Like Simplex Noise but don't like the patent? Introducing OpenSimplex Noise! on: 2014-09-23 14:37:37
In case someone is interested, here is a stripped-down 2D version of Gustavson's SimplexNoise implementation that is relatively readable. Performance is quite OK, although I do not have any benchmarking. Also, this uses a fast pseudo-random number generator, but you could use any other random generator as well.

Edit: put the code in the pastebin:
http://pastebin.java-gaming.org/fa70a2c870418
21  Game Development / Shared Code / Re: Like Simplex Noise but don't like the patent? Introducing OpenSimplex Noise! on: 2014-09-23 11:10:12
And the Lord Hath spoken: "Thou shalt Slap him with Medals!".

And Lo and Behold, he was Slappeth with many Medals.
22  Game Development / Game Mechanics / Re: Rendering order in a 2d game on: 2014-09-23 11:05:33
My question is: How do i figure out in what order to render the list of mobs/entities and the trees?

Generally you just loop over the list of entities a number of times (once for each layer) and render the entities that are part of that layer. The entities rendered in earlier loops are drawn under the ones in later loops. You could, for example, add an integer "layer" property to your entity class and use that to determine what render loop the entity is rendered on, and thus in what graphical layer it will appear.

23  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > KICKSTARTER, GREENLIGHT AND NEW BUILD LAUNCHED < on: 2014-09-23 05:55:18
Good luck Ray, I just voted on Greenlight and pledged on Kickstarter. This deserves to be built Grin
24  Discussions / General Discussions / Re: Are Java applets really "dead" for indie developers? on: 2014-09-22 14:17:03
It's quite doable to develop things in Java for web environments, only it's not done using Applets anymore.

Try Google Web Toolkit, for example. Write Java, compile to Javascript & run in the browser. No plugins required. Or develop your game in LibGDX and deploy to HTML5. That's where the future lies, for better or worse.
25  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > KICKSTARTER/GREENLIGHT/NEW BUILD MONDAY! < on: 2014-09-22 08:14:30
Awesome, good luck :-) I'll participate.
26  Game Development / Newbie & Debugging Questions / Re: Frame-Rate Independent Tickrate on: 2014-09-21 19:11:37
Include a method in your entities to return the state of the entity at the time the method was called, call that method at the start of performing the render, and store all the returned values from the entities in an array.

Okay, I can see how that could work with some effort. However, this all sounds needlessly complicated and certainly not a performance gain: deep copying all entities each loop is not free, and rendering speed is mostly done on the GPU anyway.

If you don't want to create another array for all the entity states, try including a lock/unlock method in the entities, and call those methods at the start/end of the render loop.

So the update thread waits for the rendering thread and the rendering thread waits for the update thread. Which turns this into an extremely complicated way to do exactly the same thing as just a single thread performing update and render, or am I missing something here?

Also, neither solution solves the problem posed by the OP: how to make movement independent from framerate.
27  Game Development / Newbie & Debugging Questions / Re: Frame-Rate Independent Tickrate on: 2014-09-21 08:43:04
If you have a logic thread and a render thread, you can save yourself oodles of time.

What problem does your proposed solution solve? Using threading for something like this is generally a Very Bad Idea. In your solution the properties of entities may change while the rendering is performed, potentially leading to graphical glitches (rendering half the entity at one positon, the other half at another) and even worse, crashes (if some data is altered but other not yet leading to invalid state).
28  Game Development / Newbie & Debugging Questions / Re: Frame-Rate Independent Tickrate on: 2014-09-21 08:38:51
You can use a delta time very well in your entity updates. Assuming delta is in miliseconds:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
float delay = 1000; 
public void update(float delta)
{
    // Every second tick
   delay -= delta;
    if (delay <= 0)
    {
        // Move entity, or something that should be done every second (1000 ms).
       delay += 1000;
    }
}


This is the only workable solution, really. Making game world updates independent from graphics rendering speed (or the speed of your computer) is a quite difficult topic, but there are some basic solutions that work well as a starting point. R4king, for example, posted a nice loop some time ago:
http://www.java-gaming.org/topics/about-on-my-main-loop/26222/msg/229028/view.html#msg229028

Some good reading on this is the "Fix Your Timestep" article by Fiedler. It describes several ways from simple to complex to fix this problem.
29  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-19 08:07:11
Makes me think of a visit to Nepal. Beautiful country with beautiful people, but one thing made me very uncomfortable. The Nepalese, on average, are dirt poor, and as a tourist I'm walking around basically with a Nepelese year salary as pocket money. This makes many people look at you and treat you as though you might explode in a shower of money. Can't blame them, but it makes everything you do very, very complicated compared to a situation in which the level of wealth is more equal. I expect it is somewhat like that...
30  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-18 13:14:58
Well Nate, I'm impressed by how hypothetically tough you are Wink
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.

Pippogeek (37 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (30 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (52 views)
2014-09-19 03:14:18
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!