Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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]
1  Game Development / Game Mechanics / Re: Making sexy effects for in game buttons. on: 2012-06-18 15:46:25
On a side note, the tween engine can also do that Tongue

1  
2  
float value = TweenEquations.easeInQuad.compute(elapsedTime/duration); // value is [0..1]
mySprite.setX(value*(end-start)+start);


See this for a list of all equations.
2  Game Development / Newbie & Debugging Questions / Re: Libgdx Bug (hope not) on: 2012-01-29 08:03:03
Well, not really...

From TextureRegion.java:
1  
2  
3  
4  
5  
6  
        /** @param width The width of the texture region. May be negative to flip the sprite when drawn.
         * @param height The height of the texture region. May be negative to flip the sprite when drawn. */

        public TextureRegion (Texture texture, int x, int y, int width, int height) {
                this.texture = texture;
                setRegion(x, y, width, height);
        }


I work a lot with TextureRegions, and never saw a single bug. What version do you use: a nighlies or a stable?
There are 2 constructors with such arguments, the second one takes floats instead of ints, as u/v/u2/v2 texture coordinates, so be careful to give ints if you want width/height. Just in case you changed your code before putting it here...
3  Game Development / Newbie & Debugging Questions / Re: problems with animation on: 2012-01-25 17:37:04
I can't really comment on the update method, but I know one thing: what you're trying to do is interpolating the scale of your paddle from a narrow size to a wider size, and vice-versa.

Instead of playing with state-machines and frames, I would recommend you to have a look to this library (it's not self-advertising, the lib is free, it's just that it could be a nice use-case Grin).

For instance, your Wider() method would be as follows:
1  
2  
3  
4  
5  
    public void Wider () {
        myManager.killTarget(this, SCALE_X);
        Tween.to(this, SCALE_X, 500).target(2).ease(Quart.INOUT).start(myManager);
        Tween.to(this, SCALE_X, 500).target(1).ease(Quart.INOUT).delay(EFFECT_DELAY).start(myManager);
    }


line 1: Stops any running animation affecting the scale of our paddle,
line 2: Animates the scale of the paddle from its current value to twice its size (with a nice "quart" easing) during 500ms,
line 3: Wait for EFFECT_DELAY milliseconds, then animates the scale of the paddle from its current value to its original size (with a nice "quart" easing) during 500ms.

Moreover, your update() method would be heavily trimmed, since you wouldn't need your state machine anymore.
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  
public void Update () {
        // ------------------------------------------------
       // Your whole state machine would be replaced by:

        int deltaMillis = <compute_delta_here>;
        tweenManager.update(deltaMillis);

        // ------------------------------------------------
       
        if (direction == Direction.NONE) {
            speed -= SPEEDD;
            if (speed < 0) {
                speed = 0;
            }            
        }
     
        int dx = x + speed * dm;
        if (dx + w > XRIGHT) {
            x = XRIGHT - w;
        }
        else if (dx < XLEFT) {
            x = XLEFT;
        }
        else {
            x = dx;
        }    
               
    }


Simple enough?
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2012-01-25 14:57:42
Also, I recently released a beta version of the Tween Studio library.
The library lets you create your animations using a visual editor like the one in the Flash Authoring Tool or in Microsoft Expression Blend.

More information here: http://www.aurelienribon.com/blog/2012/01/tween-studio-first-public-beta/

i'll make a dedicated topic once it will be polished enough for 1.0 release.

5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2012-01-25 14:54:22
The library is framework-agnostic. Basically, it interpolates floats from one value to an other. Therefore, these floats can be the x/y/z coordinates of your camera position for instance (to create smooth movements of the camera), or anything else. That's your decision Smiley

For instance, if your camera class is something like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
public class MyCamera {
   private float x,y,z;
   
   public void setPosition(float dx, float dy, float dz) {
      this.x = x;
      this.y = y;
      this.z = z;
   }
   
   public float getX() {return x;}
   public float getY() {return y;}
   public float getZ() {return z;}
   
   public void apply(GL10 gl) {
      gl.glTranslate(x, y, z);
   }

   ... several opengl related lines of codes...
}


Then, you would implement a TweenAccessor like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
public class MyCameraAccessor implements TweenAccessor<MyCamera> {
   public static final int POSITION = 1;

   public int getValues(MyCamera target, int tweenType, float[] returnValues) {
      switch (tweenType) {
         case POSITION:
            returnValues[0] = target.getX();
            returnValues[1] = target.getY();
            returnValues[2] = target.getZ();
            return 3;
      }
   }
   
   public void setValues(MyCamera target, int tweenType, float[] newValues) {
      switch (tweenType) {
         case POSITION:
            target.setPosition(newValues[0], newValues[1], newValues[2];
            break;
      }
   }
}


Only thing needed now is to let the engine know your implementation (required only once, in your initialization code):

1  
Tween.registerAccessor(MyCamera.class, new MyCameraAccessor());


You're done. You can now move your camera smoothly by firing tweens when you want directly on your camera object, like:

1  
Tween.to(myCamera, POSITION, 200).target(1.0f, 2.0f, 0.5f).ease(Back.OUT).start(myManager);
6  Game Development / Performance Tuning / Re: ArrayList, Hashtable, or ... for holding in-game-objects on: 2012-01-03 15:08:33
Come on... if the performances of a list are the bottleneck of your game, then I guess it's already running at 200 fps. You can stop optimizing now.
7  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2012-01-03 11:14:54
Thanks guys.

If you really want to compete with Flash, just wait for my next open-source tool: a visual editor for your animation timelines.
It's called the Universal Tween Studio, and will be as generic as the Tween Engine is.

Only thing needed is to implement the "Editor" interface, so the Studio can know what are the different properties of your objects (like "x", "y", "rotation", etc. on the following screenshot). The editor may also be enhanced so you can directly drag your objects in your game and the modifications will be propagated to the Studio, like in the Flash tool.

For now, I will provide 2 implementations of the editor as examples, dedicated to the LibGDX framework: first one is the minimal implementation (5 lines required) so anyone can create his own implementation for any other framework, and second one is an enhanced version with custom drawing (the "recording" red frame visible in the game) and direct object modification with mouse.

Stay tuned Wink



If anyone wonders, yes, it's heavily based on the Expression Blend design, since I love this tool for WPF development. Grin
8  Game Development / Shared Code / Re: easily deploy JWS and applets with Scar on: 2011-12-22 17:20:10
Beware of one-jar and lgpl libraries...
Besides that, what is the problem with shipping jar libraries with the game executable ? Every AAA title comes with a load of dll files and resources, exposing all the stuff to the user.
9  Game Development / Newbie & Debugging Questions / Re: Flickering applet on: 2011-12-20 17:26:59
No problems here (win7 32b), but you already figured your issue with OSX Smiley
Excellent game btw, I spent a lot of minutes on it, it's really entertaining and has an excellent gameplay! Reminds me of some game I had on my Texas instrument back in school.
10  Game Development / Shared Code / Re: easily deploy JWS and applets with Scar on: 2011-12-20 16:57:20
I hate ANT so much, particularly for generating a classpath string, that I'll immediately try to switch to your library for all my projects. Thanks for making this, it looks very interesting.
11  Games Center / Showcase / Re: Arcane Tactics: applet loader on: 2011-12-20 16:54:45
Neat! I love the style, very polished Cool
In my opinion, tweens are like particles: small details providing a huge extra user experience!

Don't know if you saw that wip, but it may interest you.
12  Java Game APIs & Engines / Engines, Libraries and Tools / Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2011-12-19 15:56:57


Hello!

A few months ago, I was desperately in need for an animation library, in order to make nice splash screens and UI animations for my android game. However, while Flash is crawling under powerful tweening engines, there was no such thing for java. Therefore, I made one, open-source, which reached its maturity a few days ago with the release of its 6th major revision.

A tween is basically an interpolation between two values that runs for a given amount of time. Of course, the Tween Engine does a lot more than that, and handles the life-cycles and the update mechanisms of the interpolations for you. Moreover, it enables the interpolation of every attributes from any object in any Java project (being Swing, SWT, OpenGL, Android or even console-based).

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
// In one line, send your object to another position (here x=20 and y=30),
// with a smooth elastic transition, during 1 second (1000ms):
Tween.to(myObject, POSITION, 1000).target(20, 30).ease(Elastic.OUT).start(myManager);

// Also, create complex sequences:
Timeline.createSequence()
    .push(Tween.set(...)) // First, set all objects to their initial positions
   .push(Tween.set(...))
    .push(Tween.set(...))
    .pushPause(1000)      // Wait 1 second
   .push(Tween.to(...))  // Move the objects around, one after the other
   .push(Tween.to(...))
    .push(Tween.to(...))
    .beginParallel()      // Move them all at the same time now
       .push(Tween.to(...))
        .push(Tween.to(...))
        .push(Tween.to(...))
    .end()
    .repeatYoyo(2, 500)   // repeat the whole sequence 2 times
   .start(myManager);    // and finally start it!


Feature set:
  • Zero allocation! Use your project safely on Android without fearing the garbage collector!
  • Supports every interpolation function defined by Robert Penner: http://www.robertpenner.com/easing/
  • Can be used with any object. You just have to implement the TweenAccessor interface when you want interpolation capacities.
  • Every attributes can be interpolated. The only requirement is that what you want to interpolate can be represented as a float number.
  • One line is sufficient to create and start a simple interpolation.
  • Tweens can be easily sequenced thanks to Timelines.
  • Tweens can act on more than one value at a time, so a single tween can change the whole position (X and Y) of a sprite for instance !
  • Tweens and Timelines can be repeated, with a yoyo style option.
  • Many callbacks can be specified (when tweens or timelines complete, start, end, etc.).
  • Simple timers can be built with Tween.call().
  • Source code extensively documented!
  • Wiki documentation to get you started!

Quote

I made two java applets (first one is illustrated below) to let you understand what tweens (and timelines) are, check them out Smiley
13  Discussions / General Discussions / Re: What is your favorite layout? on: 2011-12-19 15:18:35
I'm a big fan of BorderLayout and GridBagLayout, but the Netbeans editor just rocks everything.

In .NET WPF, XAML is just perfect: it can be directly edited by hand and nevertheless provides very nice results in a minimum amount of time, not to mention the easy use of the MVVM pattern. I never found anything equivalent in Java. Even data-binding is a lot more messy to use. Therefore, I've no regrets to give the control of my UIs to automated tools like the Netbeans editor (Matisse).

Time-to-market plays an important role in the choice of libraries/tools...
14  Games Center / Showcase / Re: Ludum Dare 22 - Leave me Alone!! - arielsan - Gemserk on: 2011-12-19 15:09:37
I love it, nice work ariel Smiley
Very fun gameplay, and using collision responses is a nice improvement over existing games like that!
15  Game Development / Newbie & Debugging Questions / Re: List to ArrayList? on: 2011-12-19 15:05:59
Personally, I think the major interest in separating interfaces from implementations with lists is the use of Collections.unmodifiableList(). It allows you to convert your list into a sealed list that will throw a runtime exception everytime you try to modify it. Returning such list in a getter is absolutely necessary if your design shouldn't allow the list to be modified, even if your the only user of your method.
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

pw (22 views)
2014-07-24 01:59:36

Riven (20 views)
2014-07-23 21:16:32

Riven (17 views)
2014-07-23 21:07:15

Riven (20 views)
2014-07-23 20:56:16

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (52 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!