Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (805)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5
  ignore  |  Print  
  SJGL (Now on GitHub!)  (Read 59928 times)
0 Members and 1 Guest are viewing this topic.
Offline The_FrosTy_Clan
« Reply #60 - Posted 2014-11-03 20:58:14 »

Quote
arrogant @$$3$."? Excuse me? Only one person has even made a comment that could be considered out of line. You guys need to stop with this idea of being the hero and jumping on the "back OP up" bandwagon.

CopyableCougar4

Awhhh Snnnaappppp, We got a bad@$$ over here.
Offline CopyableCougar4
« Reply #61 - Posted 2014-11-03 21:07:38 »

Quote
arrogant @$$3$."? Excuse me? Only one person has even made a comment that could be considered out of line. You guys need to stop with this idea of being the hero and jumping on the "back OP up" bandwagon.

CopyableCougar4

Awhhh Snnnaappppp, We got a bad@$$ over here.

I'm just going to stop replying, you're trying to start something and I will not be a part of it.

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline The_FrosTy_Clan
« Reply #62 - Posted 2014-11-03 21:09:02 »

Maybe you shouldn't put someone down, Just a good tip ok!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #63 - Posted 2014-11-03 21:43:47 »

I don't really understand this way of thinking. I appreciate altruism but why for do you develop this library? What does it give you? Are you looking for gratitude?

I'm not looking for gratitude, I'm looking for experience Smiley

The darkest of carts.
Offline kpars
« Reply #64 - Posted 2014-11-03 21:47:02 »

Click to Play


Drama aside, try making a game with the library and find out what it needs.

- Jev
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #65 - Posted 2014-11-04 02:37:20 »

It is times like this where I feel like singing:
"I never meant to start a war!" - Miley Cyrus, 2013

Is it sad that I still get a fright when the computer beeps at me...
Offline Opiop
« Reply #66 - Posted 2014-11-04 05:09:14 »

Jesus this thread is full of so much cringe. All of you need to take a step back and let the OP figure it out, we have given him the advice. There are no sides, this is a thread about a small library that for some reason spiraled into insulting each other and useless comments. Don't take over threads with your silly bantering, this is a place to discuss the library. Maturity is a nice quality to have sometimes.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #67 - Posted 2014-11-04 07:10:44 »

I always wonder... OP stands for over powered... What does it stand for here? I can never tell...

Is it sad that I still get a fright when the computer beeps at me...
Offline Springrbua
« Reply #68 - Posted 2014-11-04 07:35:38 »

Original poster as much as i know, so it is the one, who started the Thread.
Offline SHC
« Reply #69 - Posted 2014-11-04 08:27:16 »

There are a lot of criticisms here, so I would like to clear them up and make a summary of the thread. (I don't want to offend anyone) So here are the very important things you need to take care of, DarkCart.

  • Project Hosting

    DarkCart, you are offering everything in the form of downloads, but the main thing is nobody is going to download things without knowing what it can do. The best thing you can do is to host your project online (GitHub is better in that case) and also show some screenshots what your library is capable of.

    Hosting on the internet has it's benefits, users need not download to look at the stuff, they can browse the code online and save a lot of time themselves. It also allows people to contribute in return, or notify you of any issues or bugs, and you can fix them asap. I recommend you to host your library on GitHub to prevent these criticisms.

  • Naming Conventions

    You named your methods in a weird manner which no one really expects. Your methods start with
    gl
    in their names, which confuses many users that your library uses OpenGL, which is not the case. It's not going to benefit you, as this may cause a reduction in the number of users that are willing to try your library.

    Another example is you named your color class as
    ColorValue
    while many people prefer
    Color
    as the name. Using non-standard conventions will do nothing but scare people away. I recommend you to change these names to the correct ones to avoid the confusion of your users.

  • The Tools you Use

    Even the tools you use does matter for your users. You are using Java2D, which is not the right tool for this job. Java2D is not designed for performance efficient graphics programming, and especially not with games in mind. Since yours is a game library, you should really start using the recommended libraries, such as OpenGL. I recommend learning OpenGL and LWJGL (again I don't want to start wars, but I do prefer LWJGL) and make your library use it.

    Not only that OpenGL allows you to gain good performance and frames per second, it will also give you the ability to apply much transformations to your entities using shaders and GLSL. By the way, I'm not against Java2D, nor we hate it, we just say that it is not the right tool for games programming.

  • Proper Game Loop

    As seen in your
    ImageTest
    example, your game loop is the not the right one, and is an example of a bad game loop. You might want to look at the game loops article written by EliDelventhal in the articles section of this forum. Or you can also read the article by Koen Witters, namely deWitter's Game Loops on the KoonsoloGames website. That is more necessary for a perfect game loop.

    And again, the game loop should be built-into the
    BasicGame
    class, and you should also allow the user to switch between variable frame times or fixed frame times. A perfect library should give those.

  • Proper Demos

    You need to provide proper demos to show off what your library is capable of. ImageTest isn't one, since users need to know how to make a game with your library, just showing them on how to draw an image wouldn't suffice. The recommendation is to make as many games with this as you can (not only limited to tile based ones) and post the screenshots here. It is also important to post the code in a folder alongside with your library on github or whatever hosting you use.

Aside from these things, this entire thread is filled with arguments, they do good in the end, but I think there should not be these many criticisms arguments on a project page. Anyways, DarkCart, these are the things that you need to take care of. I wish you good luck with your game library.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #70 - Posted 2014-11-04 13:44:40 »

I always wonder... OP stands for over powered... What does it stand for here? I can never tell...

Original poster as much as i know, so it is the one, who started the Thread.

Also "Operator" sometimes, mostly in IRC. Which is kinda analogous.

Offline gouessej
« Reply #71 - Posted 2014-11-04 14:07:17 »

I'm not looking for gratitude, I'm looking for experience Smiley
Then, why not making at least one game with your library as kpars and me suggested? This is the best way to find which features are missing and a good solution to increase your experience. It would put you into the same situation than a developer who would use your library.

Julien Gouesse | Personal blog | Website | Jogamp
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #72 - Posted 2014-11-04 14:53:18 »

SJGL is now on GitHub! Woo-hoo! Link is in the OP!

The darkest of carts.
Offline gouessej
« Reply #73 - Posted 2014-11-04 15:29:51 »

SJGL is now on GitHub!
Good. I have a few suggestions:
- remove the useless branch "com/darkcart/lib/sjgl" and keep only the "master" branch
- mention clearly that your library is only suitable for desktop environments (you mention that your library is AWT-based, it's better than nothing)
- mention the license
- encapsulate better this field: https://github.com/DarkCart/SJGL/blob/master/com/darkcart/lib/sjgl/util/Sound.java#L10
- support URLs and URIs, not only filenames
- you probably meant "destroyWindow" instead of "destoryWindow" https://github.com/DarkCart/SJGL/blob/master/com/darkcart/lib/sjgl/Window.java#L100
- comment your source code a lot more
- make a game with your library

Good luck

Julien Gouesse | Personal blog | Website | Jogamp
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #74 - Posted 2014-11-04 17:03:27 »

Here we go:
The first real game created in SJGL... Find The Cake!

"Find The Cake" is a game where you play as a pixel art version of Steve, the main Minecraft character. Controlled by you, he walks around, trying to find the cake, only to discover.. it's a lie! Right as he touches the cake, it teleports to another position, much like a Enderman. How much cake can you get?

Screenshot:


As I promised, created with SJGL.

Download: here

The darkest of carts.
Offline SHC
« Reply #75 - Posted 2014-11-04 17:10:22 »

Well, your example doesn't work on OS X.



Console output here.

1  
2  
3  
4  
5  
6  
$ java -jar FindTheCake.jar
Creating Window Find The Cake
Size = 640x480
Resizable = false
Component null added to window.
$

Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #76 - Posted 2014-11-04 17:11:53 »

Well, your example doesn't work on OS X.



Console output here.

1  
2  
3  
4  
5  
6  
$ java -jar FindTheCake.jar
Creating Window Find The Cake
Size = 640x480
Resizable = false
Component null added to window.
$


Could you try running the program again? Sometimes that helps. Otherwise, I don't know.

The darkest of carts.
Offline SHC
« Reply #77 - Posted 2014-11-04 17:24:00 »

Could you try running the program again? Sometimes that helps. Otherwise, I don't know.

Is it a joke? I ran this more than 5 times and the same output.

Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #78 - Posted 2014-11-04 17:26:41 »

Could you try running the program again? Sometimes that helps. Otherwise, I don't know.

Is it a joke? I ran this more than 5 times and the same output.

No, it is by no means a joke. Works just fine on my computer (Windows).

The darkest of carts.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #79 - Posted 2014-11-04 22:15:59 »

I always seem to find problems on Mac... What I did was add ALOT more debugging info... Even info which doesn't really need to be there and then send them the new version...

Is it sad that I still get a fright when the computer beeps at me...
Offline CopyableCougar4
« Reply #80 - Posted 2014-11-04 22:19:03 »

I found some issues.

  • When I have a LWJGL program running (I forgot about it until I launched the jar), yours doesn't draw anything, and it looks like SHC's
  • When the background and text finally showed up, neither of the images were there



Operating System: Windows 8.1

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #81 - Posted 2014-11-04 22:23:19 »

I found some issues.

  • When I have a LWJGL program running (I forgot about it until I launched the jar), yours doesn't draw anything, and it looks like SHC's
  • When the background and text finally showed up, neither of the images were there

Operating System: Windows 8.1

CopyableCougar4

Issue #1: I don't know why a LWJGL program (which uses OpenGL) would affect my program (Java2D, shamefully).

Issue #2: Are you sure you extracted both of the image files, player_16x16.png and cake_16x16.png?

The darkest of carts.
Offline gouessej
« Reply #82 - Posted 2014-11-04 22:23:54 »

I have exactly the same problem than SHC under Mageia Linux 4 with OpenJDK 1.7:
[gouessej@localhost Find The Cake]$ java -jar FindTheCake.jar
Creating Window Find The Cake
Size = 640x480
Resizable = false
Component null added to window.

The images and the JAR are in the same directory.

Edit.: It worked the second time but not the first time  Clueless

Julien Gouesse | Personal blog | Website | Jogamp
Offline CopyableCougar4
« Reply #83 - Posted 2014-11-04 22:24:20 »

Quote
Issue #1: I don't know why a LWJGL program (which uses OpenGL) would affect my program (Java2D, shamefully).
This may just be something with the first time running (I Dunno)

Quote
Issue #2: Are you sure you extracted both of the image files, player_16x16.png and cake_16x16.png?
Yes

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline CopyableCougar4
« Reply #84 - Posted 2014-11-04 22:25:47 »

Sorry for the double post, but:

When I run it from the command prompt it shows up (?).

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #85 - Posted 2014-11-04 22:25:54 »

Quote
Issue #1: I don't know why a LWJGL program (which uses OpenGL) would affect my program (Java2D, shamefully).
This may just be something with the first time running (I Dunno)

Quote
Issue #2: Are you sure you extracted both of the image files, player_16x16.png and cake_16x16.png?
Yes

CopyableCougar4

I have no idea what might be going on: If you want to try compiling the source code, here you go (1 class, 100 or-so lines):

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  
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import com.darkcart.lib.sjgl.BasicGame;
import com.darkcart.lib.sjgl.Window;
import com.darkcart.lib.sjgl.simplegl.Font;
import com.darkcart.lib.sjgl.simplegl.GL;
import com.darkcart.lib.sjgl.sound.PlayMIDI;
import com.darkcart.lib.sjgl.util.Color;
import com.darkcart.lib.sjgl.util.RandomInt;

public class FindTheCake extends BasicGame implements KeyListener {
   private static final long serialVersionUID = 1L;

   // Globals
   public Window win;
   public GL gl;
   public int playerX = 300;
   public int playerY = 140;
   public int cakeX = 50;
   public int cakeY = 140;
   public int cakeFound = 0;

   public void init() {
      gl = new GL();

      PlayMIDI midi = new PlayMIDI();
      midi.loadMidi("Ringo's Theme (This Boy).mid");
      midi.playMidi();
     
      // Creating Window
      win = new Window();
      win.createWindow("Find The Cake", 640, 480, false);
      win.addTool(this);
      // Adding KeyListener to Window
      win.addKeyListener(this);
      win.setFocusable(true);
   }

   public void paint(Graphics g) {
      // Drawing text, images, background
      gl.init(g);
      gl.background(Color.lightGreen);
      gl.text("Find The Cake", Color.black, new Font("Helvetica", Font.PLAIN, 24), 230, 30);
      gl.text("Cake!", cakeX, cakeY);
      gl.text("Cake Found: " + cakeFound, new Font("Helvetica", Font.BOLD, 12), 10, 10);
      gl.loadImage("player_16x16.png");
      gl.image(playerX, playerY, 64, 64);
      gl.loadImage("cake_16x16.png");
      gl.image(cakeX, cakeY, 64, 64);
      logic();
   }

   public void logic() {
      // Collisions
      if (playerX == cakeX && playerY == cakeY || playerX == cakeX + 40 && playerY == cakeY
            || playerX == cakeX - 40 && playerY == cakeY) {
         cakeFound++;
         newPosition();
      }
   }

   public void newPosition() {
      RandomInt rand = new RandomInt();
      int rand1 = rand.nextInt(500);
      cakeX = rand1;
      repaint();
   }

   // KeyListener (inherited) methods
   public void keyPressed(KeyEvent e) {
      int keyCode = e.getKeyCode();
      if (keyCode == KeyEvent.VK_W) {
         playerY = playerY - 1;
         repaint();
      }
      if (keyCode == KeyEvent.VK_S) {
         playerY = playerY + 1;
         repaint();
      }
      if (keyCode == KeyEvent.VK_A) {
         playerX = playerX - 1;
         repaint();
      }
      if (keyCode == KeyEvent.VK_D) {
         playerX = playerX + 1;
         repaint();
      }
   }

   public void keyReleased(KeyEvent e) {
   }

   public void keyTyped(KeyEvent e) {
   }

   public static void main(String[] args) {
      FindTheCake ftc = new FindTheCake();
      ftc.init();
   }
}

The darkest of carts.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #86 - Posted 2014-11-04 22:26:39 »

Sorry for the double post, but:

When I run it from the command prompt it shows up (?).

CopyableCougar4

Oh, so you fixed it?

The darkest of carts.
Offline gzuzboey
« Reply #87 - Posted 2014-11-04 22:27:01 »

Yea, I have the same problem as copyablecougar.

Operating system: Windows 8.1

YA BOI
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #88 - Posted 2014-11-04 22:28:25 »

Yea, I have the same problem as copyablecougar.

Operating system: Windows 8.1

Try running it from the console. Worked for Copyable.

The darkest of carts.
Offline CopyableCougar4
« Reply #89 - Posted 2014-11-04 22:28:48 »

Well it shows all the images. But the collision detection doesn't work. I walked around all underneath the cake and it didn't move or do anything.

Since you're using Java2D, why not just use
java.awt.Rectangle
for collision detection, since the current one doesn't work.

Browsing the code, there are only 9 possible positions where the player can be that the cake will move.

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Pages: 1 2 [3] 4 5
  ignore  |  Print  
 
 

 
Riven (585 views)
2019-09-04 15:33:17

hadezbladez (5526 views)
2018-11-16 13:46:03

hadezbladez (2407 views)
2018-11-16 13:41:33

hadezbladez (5788 views)
2018-11-16 13:35:35

hadezbladez (1228 views)
2018-11-16 13:32:03

EgonOlsen (4667 views)
2018-06-10 19:43:48

EgonOlsen (5685 views)
2018-06-10 19:43:44

EgonOlsen (3200 views)
2018-06-10 19:43:20

DesertCoockie (4102 views)
2018-05-13 18:23:11

nelsongames (5118 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04: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!