Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (744)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 4 5 [6] 7 8 ... 10
 51 
 on: 2016-06-24 22:16:39 
Started by Hydroque - Last post by Hydroque
I have a really cool plugin build I'd like to share aloud.

So the build goes,
> you have 'raw' classes full of enums and functions that have an empty body (and throws if need-be)
> You jar those classes, with their packages
> These functions you made are in the program that uses the plugin. Note the packages need to be the same and stuff
> Extend the abstract class plugin which has 3 functions: init, run, close
> Export your jar, without the raw classes jar
> You load the settings file which comes in the jar
> You load the class using forName() with urlclassloader, using the plugin class found in the settings
Example: main: com.whatever.MainPlugin
> Utilize the .newInstance() Plugin you have to do stuff

So in my terrain editor, I just built up something like this. Works flawlessly and love it!


 52 
 on: 2016-06-24 22:16:25 
Started by NegativeZero - Last post by NegativeZero
They're much cooler to look at in VR  Pointing
Probably cooler with cardboard thing. I don't think they are made for ipads and I have a shattered phone (first time having a shattered screen qq).

... the "cardboard thing" is VR.

 53 
 on: 2016-06-24 22:08:31 
Started by NegativeZero - Last post by Hydroque
They're much cooler to look at in VR  Pointing
Probably cooler with cardboard thing. I don't think they are made for ipads and I have a shattered phone (first time having a shattered screen qq).

 54 
 on: 2016-06-24 21:40:41 
Started by NegativeZero - Last post by NegativeZero
it's inconvenient, massively expensive, and gimmicky.

So how would describe, for example, an iPad?
Or.. (at the time of their inception) a television?

Anyone have been seeing the 3D videos on facebook and youtube?
I think those are really neat.

They're much cooler to look at in VR  Pointing

 55 
 on: 2016-06-24 20:48:00 
Started by TritonDreyja - Last post by ItsAJavaGame
So this is cool but how is it going to be different / better from Terraria? Also, it's very slow on my computer.. and my computer is no slouch.

 56 
 on: 2016-06-24 19:53:13 
Started by MrPork - Last post by Gjallar
In my game I have the words "Make Great America Again!" in the Main menu?

<a href="http://www.youtube.com/v/hk2wuT9GW3Y?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/hk2wuT9GW3Y?version=3&amp;hl=en_US&amp;start=</a>

I think you're golden.

 57 
 on: 2016-06-24 19:02:47 
Started by TritonDreyja - Last post by TritonDreyja
You can now kill the bunnies for XP.
This became oddly fun for me..
<a href="http://www.youtube.com/v/q8wgG97cHa4?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/q8wgG97cHa4?version=3&amp;hl=en_US&amp;start=</a>
Animal drops will be very salvageable to take advantage of the 5x5 crafting grid.

Right after this video was recorded, I also fixed the sword holding so that it isn't pointing at the ground.

 58 
 on: 2016-06-24 18:06:11 
Started by TheUzo007 - Last post by Opiop
What version of Gradle do you have installed?

 59 
 on: 2016-06-24 18:02:15 
Started by Hydroque - Last post by Opiop
Reinventing the wheel is nice when you're learning, but reinventing the wheel when there's already a well known existing solution and you're trying to get people to use your solution instead... well that's most likely a waste of time.

I'm not trying to make you feel bad. But I've seen a lot of "engines"/frameworks started here, and months later they are no longer in development. If you're making it for yourself, great! But don't expect other people to take up your solution when there's already *hugely* popular frameworks out there that have been solving problems for years. If your goal here is to get people to use your framework then I would advise you to get a team together and really hammer out a lot of solid features. Otherwise I wouldn't bother.

Efficiency is king when it comes to development, why would anyone decide to learn an entirely new framework that may not support all the features they used in their old framework? I think most game developers would rather stick with their tools that they already know work, that way they can just focus on making their games. I think part of what you don't understand is that a lot of us have tried to create their own game frameworks. Some of us were successful, a lot of us weren't. But I think in the end most of us learned that they're just for personal use, not to try to get others to use. We *do* have the experience, and a lot of us are trying to help you so you don't stumble before you can take off running (making games). I think everyone here would love to see you make a popular framework or game which is why we are trying to guide you. Every head strong "newbie" that has come through here (you're definitely not the first) always goes down the same route you're going. A couple of them have gone on to work on some really cool projects after they realize they're wasting their time with the whole "try my framework" thing. The ones who didn't realize that might be working on cool projects now too, but it took them longer to get to that goal. If you would seriously just sit down and listen to what some of us have to say you would learn a lot, and it might set you up for success earlier.

Quote
I already hate the current coding style we do. You have a main function then hundreds of sets of functions that are called once or twice. So called, "helper functions." I don't really think that is digressing, but you see my point.

What do you even mean by this? Condensing code isn't always the answer, sometimes sprawling code bases are necessary to keep code efficient and re-usable. Trying to force everything into huge functions is exactly what leads to what you're complaining about; unnecessary labyrinths. Not to mention, functions are self documenting when used correctly. Reasonably splitting up code into smaller functions that are properly named and have just the right scope makes code infinitely more readable. Sometimes it's necessary to have a function that is maybe only called once or twice, and I think knowing when to do that is part of moving forward as a programmer. Design is just as important as the actual code you write otherwise you're going to end up writing some pretty god awful spaghetti code.

Anyway.

For the love of god, don't pick apart my response to try to prove me wrong. Read some of the posts your peers here have taken the time to write out to you and really consider them instead of just tossing them aside because they might hurt your feelings a little bit. There are some brilliant people here you could learn a lot from, and not just about game design but about development as a whole. I haven't worked on a game project in years now, but I learned a lot about development and now I'm a professional software developer. I can attribute part of my "success" to some of the users here. Open your mind and seriously consider what people have to say, that's all I'm really asking you to do.

 60 
 on: 2016-06-24 16:45:58 
Started by bornander - Last post by bornander
In this game I use dialog-boxes for simple messages, for example instructions show at the beginning of a tutorial level;

With libGDX and it's GlyphLayout it's easy to construct these.

I construct the fonts as bitmap fonts, but I generate them at run-time using the FreeTypeFontGenerator as it means I can easily modify the fonts without having to re-process my assets;

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  
public class FontAssets implements Disposable {
   public final BitmapFont dialog;
   public final BitmapFont menu_title;
   
   public FontAssets() {
      dialog = buildFont("fonts/Chewy.ttf", 48, 4, Color.BLACK, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"!`?'.,;:()[]{}<>|/@\\^$-%+=#_&~*");
      menu_title = buildFont("fonts/Chewy.ttf", 128, 12, Color.BLACK, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"!`?'
.,;:()[]{}<>|/@\\^$-%+=#_&~*");
   }
   
   private static BitmapFont buildFont(String filename, int size, float borderWidth, Color borderColor, String characters) {
      FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal(filename));
      FreeTypeFontParameter parameter = new FreeTypeFontParameter();
      parameter.size = size;
      parameter.borderColor = borderColor;
      parameter.borderWidth = borderWidth;
      parameter.characters = characters;
      parameter.kerning = true;
      parameter.magFilter = TextureFilter.Linear;
      parameter.minFilter = TextureFilter.Linear;
      BitmapFont font = generator.generateFont(parameter);
      font.getData().markupEnabled = true;
      generator.dispose();
      return font;
   }

   @Override
   public void dispose() {
      dialog.dispose();
   }
}


When using the font I first set the GlyphLayout to the text I want;

1  
2  
3  
4  
5  
   public void openDialog(String text) {
      dialogEnabled = true;
      float dw = vWidth * 0.8f;
      dialogGlyphLayout.setText(Assets.instance.fonts.dialog, text, Color.WHITE, dw, Align.topLeft, true);      
   }


Here vWidth is the virtual or logical width of the screen, and I am telling the GlyphLayout to render at 80% of the width of the screen and wrap if longer.

Then, when rendering the Stage the text and it's background is rendered like this;
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
      if (dialogEnabled) {
         spriteBatch.setProjectionMatrix(stage.getCamera().combined);
         spriteBatch.begin();
         
         float tw = dialogGlyphLayout.width;
         float th = dialogGlyphLayout.height;
               
         float dw = tw + 0.05f * vWidth;
         float dh = th + 0.05f * vWidth;
         
         float bx = (vWidth - dw) / 2.0f;
         float by = vHeight - dh * 1.2f;
         
         Assets.instance.hud.panel_metal.draw(spriteBatch, bx, by, dw, dh);
         Assets.instance.fonts.dialog.draw(spriteBatch, dialogGlyphLayout, bx + (dw-tw) / 2.0f, by + dh - (dh-th) / 2.0f);
         
         spriteBatch.end();
      }


This sets up a nine-patch which is the background to have a 5% padding, and then draws the message.

To get the different words highlighted requires no special code as the input string can be marked-up to change color;
1  
[WHITE]DRAG THE WOODEN BOX TO THE [BLUE]GAP[WHITE] TO LET THE [GREEN]ALIEN[WHITE] CROSS.


Super simple.

Pages: 1 ... 4 5 [6] 7 8 ... 10
 
CopyableCougar4 (23 views)
2016-06-25 16:56:52

Hydroque (57 views)
2016-06-22 02:17:53

SwampChicken (59 views)
2016-06-20 13:22:57

SwampChicken (59 views)
2016-06-20 13:22:49

SwampChicken (55 views)
2016-06-20 13:22:26

Hydroque (98 views)
2016-06-15 08:22:50

Hydroque (89 views)
2016-06-13 06:40:55

DarkCart (215 views)
2016-05-29 02:30:33

Hydroque (175 views)
2016-05-26 14:45:46

Mac70 (172 views)
2016-05-24 21:16:33
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
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!