Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (555)
Games in Android Showcase (149)
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 ... 5
1  Discussions / General Discussions / Re: Does Java have 'pointers on: 2015-02-20 14:48:53
[EDIT] I know that I have muddled up a few things in the original post because I wasn't thinking straight. What I'm trying to say is that Java References embed the concepts of a 'pointer' within it, hence Java does have pointers. While programmers are not really able to access this pointer to do arithmetic operations, it still exists and works in the background.

I won't be surprised if you call the 'pp' variable in the code below as 'pointer to pointer'  Tongue:

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  
public interface ISome {
}

public class SomeClass  implements ISome {
   
}

public class Delegate implements ISome {
   private ISome delegate;

   public void setDelegate( ISome delegate ){
       this.delegate = delegate;  
   }
   
   public ISome getDelegate() {
       return delegate;
   }

}
...

ISome p = new SomeClass();
ISome pp = new Delegate();

pp.setDelegate(p);
...

2  Game Development / Newbie & Debugging Questions / Re: convert expression for use with vecmath on: 2015-02-16 08:13:49
javax.vecmath creates so much garbage that it is best avoided
Unfortunately I need it for jbullet

I'd recommend you to try to use openMaLi. Here is the conclusion of the author of the JBullet. Though, it is rather negative, openMaLi was improved since then and is much more GC-friendly.
Also, its API is similar enough to vecmath, so I think you can easily replace the vecmath code with the openMaLi one's in the JBullet (maybe, even, at the 'Find-Replace' level), IIRC, someone's performed the similar task. I would find the links If you will be interested in. So, maybe there's the reason to try.
Btw, you can have a look at the JME's  experience. AFAIK, it has its own math library and uses JBullet.
3  Discussions / Business and Project Management Discussions / Re: [NON PAID]Builders game - Looking for motivated ppl on: 2015-02-13 14:52:50
See also: http://shouldiworkforfree.com/

The only thing missing from that flowchart is "is it for a complete stranger?"

Did you call me? Smiley
4  Discussions / General Discussions / Re: New feature: mentions in posts on: 2015-02-11 05:20:59
@Riven: I'd like to mention about my mentions.  Smiley I think they're partly wrong because anybody hardly could know about my existence before I registered here in 2009.
This is the link from the previous post and the quote from the link.
Quote
... I see a tall dark stranger saying "Not invented here"...
5  Discussions / General Discussions / Re: New feature: mentions in posts on: 2015-02-10 06:07:36
It's quite fun. I'm often mentioned, even in ancient 2003Grin
6  Game Development / Networking & Multiplayer / Re: Feedback on reliable UDP implementation on: 2015-02-10 05:56:34
It's not neccessary to treat all the packets as reliable. A part of them may be remaining unreliable as in the ordinary UDP.
7  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-07 06:56:45
If you'd allow me to dream, then I'd tell about ML. 'Learning from examples' it's just a kind of TDD. Examples of the behavior of the target program are in fact the tests. Thus process of developing the software becomes generate-and-test process. Though, whether these ideas could be ever reified in some real, industrial-strength frameworks? I don't know. Maybe they'll be spread in other forms in some more specific technologies ... Excuse me if I brought a cloud of dust to this discussion Roll Eyes  Smiley.
8  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-05 14:00:04
Frankly, I often forget what is the difference between unit and functional tests, so I have to recall that permanently... Undecided Smiley  Can anybody also mention about mock frameworks. Nice thing in the unit testing, isn't it?
9  Discussions / Miscellaneous Topics / Re: Ian Allen, my good friend and top "tester" died and is becoming famous! on: 2015-01-24 12:55:35
My condolences.
10  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-30 12:41:50
I could also run the jar, but I don't know how to configure jwrapper properly.

I'd like to clarify the things.

I meant that I made win-offline.exe working  (game's jframe appears) after modification the java sources.
11  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-30 08:33:17
Hi Dreamtime

I made the game window appeared. It repeated every time I ran 32 bit or 64 bit - exe. Though I've seen no console  output when running the exe. It's appearing only when i simply run the jar.
It happened after I modified the sources:

Game.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  
package game;

import javax.swing.*;
import java.awt.*;


public class Game
{
    Draw draw;
    Frame frame;
    Insets insets;

    boolean isRunning = true;


    private int FPS = 30;
    private double averageFPS;

    public static void main( String[] args )
    {
        System.out.println( "Hello! "+  Thread.currentThread() );
        Game game = new Game();
        game.run();
//
        //   System.exit( 0 );
    }

    void run()
    {
        final Runnable doHelloWorld = new Runnable()
        {
            public void run()
            {
                System.out.println( "Hello World on " + Thread.currentThread() );
            }
        };

        Thread appThread = new Thread()
        {
            public void run()
            {
                try
                {
                    SwingUtilities.invokeLater( doHelloWorld );
                    initialize();

                    long startTime;
                    long URDTimeMillis;
                    long waitTime;
                    long totalTime = 0;

                    int frameCount = 0;
                    int maxFrameCount = 30;

                    long targetTime = 1000 / FPS;

                    while ( isRunning )
                    {
                        startTime = System.nanoTime();

                        update();
                        draw();

                        URDTimeMillis = ( System.nanoTime() - startTime ) / 1000000;

                        waitTime = targetTime - URDTimeMillis;

                        try
                        {
                            Thread.sleep( waitTime );
                        }
                        catch ( Exception e )
                        {

                        }

                        totalTime += System.nanoTime() - startTime;
                        frameCount++;

                        if ( frameCount == maxFrameCount )
                        {
                            averageFPS = 1000.0 / ( ( totalTime / frameCount ) / 1000000 );
                            frameCount = 0;
                            totalTime = 0;
                        }

                    }

                    frame.close();
                }
                catch ( Exception e )
                {
                    e.printStackTrace();
                }
                System.out.println( "Finished on " + Thread.currentThread() );
            }
        };

        appThread.start();
    }

    void initialize()
    {
        draw = new Draw();
        frame = new Frame();

        frame.add( draw );
    }

    void update()
    {
    }

    void draw()
    {
        System.out.println( "Game running on " +  Thread.currentThread()  );
        //frame.draw();
    }
}


Frame.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  
package game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Frame extends JFrame
{
    int windowWidth = 960;
    int windowHeight = 480;
    Insets insets;

    public Frame()
    {
        setTitle( "Game" );
        setSize( windowWidth, windowHeight );
        setResizable( false );
        //  setDefaultCloseOperation( EXIT_ON_CLOSE );
        setDefaultCloseOperation( DO_NOTHING_ON_CLOSE );
        addWindowListener( new WindowAdapter()
        {
            /**
             * Invoked when a window is in the process of being closed.
             * The close operation can be overridden at this point.

             * @param e
             */

            @Override
            public void windowClosing( WindowEvent e )
            {
                System.out.println( "Good Bye World on " + Thread.currentThread() );
                System.exit( 0 );
            }
        } );

        insets = getInsets();
        setSize( insets.left + windowWidth + insets.right, insets.top + windowHeight + insets.bottom );

        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation( dim.width / 2 - this.getSize().width / 2, dim.height / 2 - this.getSize().height / 2 );

        setVisible( true );
    }


    public void close()
    {
        setVisible( false );
    }
}


I modified also jwrapper.xml a bit but I think it does no affect the result in fact because I've ran the xml with initial build without the success.
12  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 12:18:33
Quote
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
SLF4J: Defaulting to no operation (NOP) logger implementation
It's the warning of 'Simple Logging Facade for Java'. Nothing special.
13  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 12:04:47
I use jwrapper but exe shows splash once then nothing...
14  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 11:43:11
jar runs fine. Building exe in process
15  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 11:38:24
Do you have any experience with packr?
I didn't hear about that. I think I have  Grin

I badly slept this night and gonna freaking out with specifying jre's location.
I thought it's enough to specify JAVA_HOME and JRE_HOME  Roll Eyes
and I can work with win jre ...
16  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 11:21:23
yep
17  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 11:11:46
Hahahaha what?
Forget it... Smiley

I am looking at packr now. No clue what's going on with jwrapper.

Hopefully I can get past my own incompetence with packr.
Good to know.

Tell me, you specified 32 bit jre for both win tags?
18  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 10:51:36
should i really download linux jre mandatorily?
19  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-28 11:49:41
The only thing I can suggest by now - add normal package to your classes.
Then specify the fully qualified main-class name in manifest , xml
20  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-28 10:30:53
Of course, you've ran 'gameapp-java-online.jar' or
'gameapp-windows32-offline.exe' (or something like this) in jwrapper's 'build' folder?

As I get it, you will have such a file after app's  building finished:

Quote
java.exe -Xmx512m -jar jwrapper-00031607960.jar gameapp\jwrapper.xml
21  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-28 07:16:50
Hi Dreamtime,

I'm still asking about classpath...

As it's said in Jwrapper's docs:
Quote
If you want to add a file which is part of your classpath you can add a classpath attribute:

<File classpath="yes" >jars/myjar.jar</File>

In your xml specified:
Quote
<File classpath='yes'>gameapp/game.jar</File>

I think it means that you're declaring 'gameapp' as package that's missing in your Game class (you're using default package).
If you use default package you should specify '." (current directory) in your classpath (at least if you specify -cp or -classpath in java's cmd line).

Btw,  as it's also said in Jwrapper docs:
Quote
If you want to add a file and give it a specific path after installation relative to your app's installation folder you can specify a path attribute:

<File classpath="yes" path="mainjar.jar" >jars/myjar.jar</File>
if I get it right it's your case.

So, please tell how your app's cmd line is looked.

Also, I recommend you to add explicit package to your class. It may make your life much easier ;-) .

PS
Nevertheless, could you please check if the 'Manifest.txt' is ended with \n or \r.

Hope it all will help and I wasted Internet traffic usefully :-).
22  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-27 12:34:00
Quote from: Dreamtime link=topic=35173.msg333056#msg333056

Edit: My manifest.txt for the jar file is just "Main-Class: Game"

1. We first create a text file named Manifest.txt with the following contents:

Main-Class: MyPackage.MyClass

Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

========================
2. How your classpath is defined?

1. If I did that incorrectly, would the .jar not run? Because it does. Is the manifest important part of Jwrapped application?

2. I don't understand what you mean.
1. this warning is from oracle docs. Manifest is the part of jar.
I can't say anything about JWrapper.
2. What you specified in classpath?
23  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-27 10:42:58
Quote from: Dreamtime link=topic=35173.msg333056#msg333056

Edit: My manifest.txt for the jar file is just "Main-Class: Game"

1. We first create a text file named Manifest.txt with the following contents:

Main-Class: MyPackage.MyClass

Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

========================
2. How your classpath is defined?
24  Game Development / Newbie & Debugging Questions / Re: Running .jar error main class not found. on: 2014-12-23 18:20:14
maybe extra char occurred in manifest: trailing space, \r\n -> \r, eof?
25  Game Development / Newbie & Debugging Questions / Re: 3D GPU animation skinning issue on: 2014-12-12 06:00:37
It seems that the influences are assigned wrongly, at least.
26  Game Development / Newbie & Debugging Questions / Re: Initialising variables in a constructor or in the class body on: 2014-12-05 17:48:18
AFAIK, Compiler will make the first class def. from the second.
27  Discussions / General Discussions / Re: Parsing SVG files on: 2014-11-30 17:02:21
Hi,

I've found one more library for SVG rendering: JFreeSVG 
28  Game Development / Artificial Intelligence / Re: Make an Entity in 3D face a specific angle? on: 2014-11-27 13:01:58
I have found the similar case. Hope it will help.

http://www.java-gaming.org/index.php?topic=21947.0
29  Game Development / Artificial Intelligence / Re: Make an Entity in 3D face a specific angle? on: 2014-11-26 14:32:36
Please, post some more code.
30  Game Development / Artificial Intelligence / Re: Make an Entity in 3D face a specific angle? on: 2014-11-26 07:39:57
At least, your code should look like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
double theta = Math.atan2(dz, dx), angle = this.getRotY() + Math.toDegrees(theta);
 //dz and dx are the sides of the triangle that I use for distance
         
if (angle == 0)
   increaseRotation(0, 0, 0);
else if (angle > 180)
        increaseRotation(0, (float) (-angle), 0);
else
        increaseRotation(0, (float) (angle), 0);
Pages: [1] 2 3 ... 5
 
BurntPizza (37 views)
2015-02-27 06:09:35

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

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

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

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

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

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

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

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

BurntPizza (37 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!