Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (138)
games submitted by our members
Games in WIP (594)
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 / 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.
2  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.
3  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.
4  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.
5  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...
6  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
7  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 ...
8  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 11:21:23
yep
9  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?
10  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?
11  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
12  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
13  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 :-).
14  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?
15  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?
16  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?
17  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.
18  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.
19  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 
20  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
21  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.
22  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);
23  Discussions / Miscellaneous Topics / Re: C#, did Microsoft just want to be different? on: 2014-11-25 10:32:40
IIRC, something similar was in C++ v1  Huh
24  Game Development / Newbie & Debugging Questions / Re: LibGDX ClassCastException on: 2014-11-22 07:35:36
Maybe you put a String value in properties somewhere?
25  Game Development / Newbie & Debugging Questions / Re: Create a simple box with a texture !!! on: 2014-11-21 19:30:29
Try to add flag Box.GENERATE_TEXTURE_COORDS to Bpx ctor call.
26  Game Development / Newbie & Debugging Questions / Re: TransparencyInterpolator with Text3D on: 2014-11-18 17:18:18
I hope here is what you need.
27  Game Development / Networking & Multiplayer / Re: Three Solutions to UDP's Critical Packet Loss on: 2014-11-17 19:05:20
Solution Two
... This cycle is repeated until a valid confirmation packet arrives.
I think it is better:
This cycle is repeated until a valid confirmation packet arrives, or connection timed out.
28  Discussions / General Discussions / Re: Parsing SVG files on: 2014-11-16 07:48:02
I've found some links:

http://xmlgraphics.apache.org/batik/

Android
https://code.google.com/p/andengineexamples/
https://code.google.com/r/newtondev-svg/

Qt
http://qt-project.org/wiki/QtWhitepaper
rendering-vector-graphics-in-opengl Look at 1st answer
http://qt-jambi.org/ Qt Jambi - Qt for Java

http://sourceforge.net/projects/libsugar/
29  Game Development / Game Mechanics / Re: SMD skeleton problems on: 2014-11-15 09:53:21
I  not entirely get how do you convert the bones.
As i realize SMD bones are, in fact, joints.
so, an8 bones = SMD bones - 1.

What do you think?
30  Game Development / Game Mechanics / Re: SMD skeleton problems on: 2014-11-14 18:51:03
i tried switching roty and rotz. just got a different weird looking skeleton
It seems we simplified the solution overly Undecided Smiley.
Insert this for positions:
1  
2  
3  
+   temp = sb.y;
+   sb.y= sb.z;
+   sb.z = -temp;
Pages: [1] 2 3 ... 5
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

theagentd (14 views)
2015-01-28 15:33:52

GamerIDGoesHere (24 views)
2015-01-27 01:23:23

GamerIDGoesHere (23 views)
2015-01-27 01:22:15

CopyableCougar4 (31 views)
2015-01-27 00:34:41

CopyableCougar4 (19 views)
2015-01-26 04:47:56

Olo (14 views)
2015-01-25 21:26:00

Olo (17 views)
2015-01-25 18:44:22

Robo11 (32 views)
2015-01-25 06:14:26

basil_ (28 views)
2015-01-17 22:29:32

wxwsk8er (27 views)
2015-01-16 21:42:21
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

Resources for WIP games
by CogWheelz
2014-08-01 16:20: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!