Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (555)
Games in Android Showcase (148)
games submitted by our members
Games in WIP (601)
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 ... 43
1  Game Development / Newbie & Debugging Questions / Re: Java 'this' syntax on: 2015-02-27 20:02:44
Previously I used to use 'dis' variable to store this Cheesy
2  Game Development / Newbie & Debugging Questions / Re: Java 'this' syntax on: 2015-02-27 13:20:53
Well that was easy Cheesy
3  Game Development / Newbie & Debugging Questions / Java 'this' syntax on: 2015-02-27 13:19:13
I constantly run into this problem:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
class MyClass implements MyInterface {
   
   private Runnable runnable = new Runnable() {
      @Override
      public void run() {
         // SecondClass class = new SecondClass(this);
         // I want to pass 'MyClass' as 'this' parameter.
         // Is it possible to achieve somehow?
      }
   };
}

class SecondClass {
   SecondClass(MyInterface interface) {
   }
}


Is there a proper way to handle this?
4  Game Development / Newbie & Debugging Questions / Re: LibGDX:How to create Key Value pairing holding info for different datatypes on: 2015-02-25 12:25:18
Use json:
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  
{
   "book_list": [
      {
         "autor": "Dr. Seuss",
         "title": "Dr. Seuss",
         "subtitle": "Dr. Seuss",
         "year": "Dr. Seuss",
         "button_image": "/path/to/image.png"
         "main_image": "/path/to/image.png"
      },
      {
         "autor": "Dr. Seuss",
         "title": "Dr. Seuss",
         "subtitle": "Dr. Seuss",
         "year": "Dr. Seuss",
         "button_image": "/path/to/image.png"
         "main_image": "/path/to/image.png"
      },
      {
         "autor": "Dr. Seuss",
         "title": "Dr. Seuss",
         "subtitle": "Dr. Seuss",
         "year": "Dr. Seuss",
         "button_image": "/path/to/image.png"
         "main_image": "/path/to/image.png"
      },
      {
         "autor": "Dr. Seuss",
         "title": "Dr. Seuss",
         "subtitle": "Dr. Seuss",
         "year": "Dr. Seuss",
         "button_image": "/path/to/image.png"
         "main_image": "/path/to/image.png"
      }
   ]
}


Then somewhere in your java code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
Map<String, Book> books = new HashMap<String, Book>();

JSONObject json; // Parse json object

JSONArray jsonBooksList = (JSONArray) json.get("book_list");

for (int i = 0; i < jsonBooksList.size(); i++)
{
   JSONObject jsonBook = (JSONObject) jsonBooksList.get(i);

   String author = jsonBook.getString("author");
   String title = jsonBook.getString("title");
   String subtitle = jsonBook.getString("subtitle");
   int year = jsonBook.getInt("year");
   String buttonImage = jsonBook.getString("buttonImage");
   String mainImage = jsonBook.getString("mainImage");

   Book book = new Book(author, title, subtitle, year, buttonImage, mainImage);
   books.put(title, book);
}


The implementation of getting data from json objects will differ from json lib to json lib.
5  Game Development / Newbie & Debugging Questions / Re: LibGDX Tilemap Rendering on: 2015-02-25 08:49:06
Should be .getWidth() / 2 and .getHeight() / 2

Also, maybe Tiled map renderer wants tile positions? In which case you also need to divide these coordinates by tile size.
6  Game Development / Newbie & Debugging Questions / Re: LibGDX:How to create Key Value pairing holding info for different datatypes on: 2015-02-24 14:38:31
@Narokomi please just go with what @KevinWorkman suggested.
7  Java Game APIs & Engines / OpenGL Development / Re: How to set texture coords without duplicate vertex positions on: 2015-02-24 06:58:59
Does your "Gui" mean a UI element?
8  Discussions / Miscellaneous Topics / Art peoples on: 2015-02-22 20:05:06
Does anybody know places to find art peoples who would do art "for free" as in most of us are making games "not for profit"? I guess I'm just looking for people who want their art to be put in the game for free Cheesy

I have been making a game and I'm at a point where I probably need to start integrating some art, because most of the other stuff is pretty much done.
9  Game Development / Newbie & Debugging Questions / Re: bounds.contains() problem on: 2015-02-21 10:53:08
What is the class of 'bounds' and on what platform are you getting this error?

Even though you can compile using that method, when running on say android, some methods might not be available at runtime or something like that, causing errors like these.
10  Game Development / Game Mechanics / Re: Releasing resources on: 2015-02-20 15:39:26
You might need to manually call Texture.dispose, because it is GL memory and not memory that will be collected by GC.
11  Game Development / Game Play & Game Design / Re: Terrain Chunk Sizes on: 2015-02-18 18:48:02
The reason you use power of 2 sizes is so that you can do bit shifting stuff, because it is faster than multiplication / division.

1  
2  
int chunkIndX = tileX / 16;
int chunkIndX = tileX >> 4; // should be faster than the first one


But maybe I'm wrong..
12  Java Game APIs & Engines / Java 2D / Re: VSync on: 2015-02-18 15:52:31
It is possible. Get the monitor's refresh rate then cap your game loop to that number.

I believe that's all vsync is.

No it is not. It is called sync for a reason.
This is what you would get if you just cap your loop to the monitors refresh rate, which still gets you screen tearing.
----------------------------------------------
   |   |   |   |   |   |   |   |   |   |   |   |   |
----------------------------------------------
 |   |   |   |   |   |   |   |   |   |   |   |   |   
----------------------------------------------

vsync does this:
----------------------------------------------
   |   |   |   |   |   |   |   |   |   |   |   |   |
----------------------------------------------
   |   |   |   |   |   |   |   |   |   |   |   |   |
13  Java Game APIs & Engines / OpenGL Development / Re: [Solved] Rendering text in lwjgl without slick on: 2015-02-18 11:21:59
@Icass

Would probably be better to just render the text to texture and then only render 1 texture instead of rendering VBO each time.

PS
dat code style though
14  Discussions / General Discussions / Re: What's your day job? on: 2015-02-16 07:44:08
My friends are still in high school and I work for this:
www.on-5.com

Its been an amazing experience, because they hired me even though I had no formal education and almost no programming experience, and over the last 10 months period I worked hear I would think that my programming capabilities at least doubled or even tripled compared to what it was before.
15  Game Development / Newbie & Debugging Questions / Re: [LibGDX] How to strech my game on android device? on: 2015-02-15 07:03:35
Change your matrix to use Gdx.graphics.getWidth() instead of 800
16  Discussions / Miscellaneous Topics / Re: What is your line/char count? on: 2015-02-14 09:07:55
Dayum I thought my project was a bit bigger Cheesy

Only 7k lines with lots of empty lines Smiley
17  Game Development / Performance Tuning / Re: FPS drop when screen recording a libGDX developed game on: 2015-02-14 06:41:33
Did you try busy loop running your game to see how much FPS it can make without recording? Maybe your game is barely able to put out 60 fps, which could explain the double drop in FPS.
18  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 21:59:43
You create another thread and then wait for it?
19  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 21:36:34
Like cylab said, I also don't really understand why would you not just use a simple Runnable interface for this purpose and want to hack stuff like that.
20  Discussions / Business and Project Management Discussions / Re: Recruitment for Team Technic on: 2015-02-13 06:42:39
To me it sounds like he is trying to hire programmers who will make complete game for him, but he isn't going to pay them anything unless the game is a success and starts selling.
21  Game Development / Newbie & Debugging Questions / Re: [Render]Help rendering a word in exactly place on: 2015-02-12 15:40:52
Can you please upload a picture of how things are looking at the moment with your render code?

Use www.imgur.com if you want its free and you don't even have to create an account.
22  Java Game APIs & Engines / OpenGL Development / Re: [Solved] Rendering text in lwjgl without slick on: 2015-02-11 07:32:32
@minigame

You are not supposed to be drawing 50 strings each frame. You are supposed to render text to a texture which you draw every frame and only render text to textures again once the text changes.
23  Discussions / Miscellaneous Topics / Re: Bit pissed off at uk school system... on: 2015-02-10 18:47:20
Do students have the right to resist being searched?
24  Game Development / Articles & tutorials / Re: Java 2D Game Programming Tutorial For Beginners! on: 2015-02-10 18:18:26
I think people need to stop making beginner programming tutorials and start making advanced programming tutorials, as there are a lot of former and not so much if any of the latter.
25  Discussions / Miscellaneous Topics / Re: The joys of game dev in C++ on: 2015-02-10 06:25:40
Thanks junkdog for suggesting valgrind.

I got it working for the app in three days, though it doesn't show line numbers or addresses mean anything when doing addr2line with them. Will probably take one or two more days to get that working, but I think it will be worth it!
26  Java Game APIs & Engines / OpenGL Development / Re: Rendering text in lwjgl without slick on: 2015-02-08 18:37:57
Are you looking only for Windows or also other platforms?
27  Discussions / Miscellaneous Topics / Git GUI tools for Windows on: 2015-02-08 09:20:07
I'm looking for a Git GUI tools that would show code changes like Differential (Phabricator) in a 2 panel fashion with old code on the left and new code on the right. Any suggestions?
28  Game Development / Newbie & Debugging Questions / Re: Strategies for Handling Large Tile Maps? on: 2015-02-07 07:01:41
Only draw tiles that are on screen.
29  Games Center / WIP games, tools & toy projects / Re: The Minecraft RPG on: 2015-02-07 06:41:05
I found le bug. When I was told to give the map to "Brome"? and he told me to wait, I went back to William thinking he might tell me something. He said "What are you waiting for?", so I decided to go back to Brome. But I couldn't, the path way to Brome said "I should have a look at this 'hidden treasure'". Now I'm stuck Cheesy
30  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Patch v1.4 out now!) on: 2015-02-04 20:47:28
It is kind of annoying that you can't throw stuff diagonally.
Pages: [1] 2 3 ... 43
 
BurntPizza (25 views)
2015-02-27 06:09:35

BurntPizza (20 views)
2015-02-27 05:56:17

Riven (11 views)
2015-02-27 02:34:15

Riven (18 views)
2015-02-27 01:47:26

Riven (18 views)
2015-02-27 01:46:04

BurntPizza (14 views)
2015-02-27 00:52:04

BurntPizza (15 views)
2015-02-27 00:50:29

Riven (35 views)
2015-02-26 23:38:45

Riven (12 views)
2015-02-26 23:37:24

BurntPizza (30 views)
2015-02-26 21:13:04
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

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!