Soccer animation using java2D

Hi all,
I am developing a soccer game for fun. I've already done a simple animation, with squares instead of players and a green screen with white lines as the field. Althouth this simplicity. The only technique I've used is double-buffering. The system runs a bit slow.
I don't have many experience in java graphics. Which advice could you give me to get a good animation?
I'm still trying to find how I am going to get the players to have a transparent background. I mean, if I draw a picture with the player, it is going to be a rectangle, but I would like to draw only the shape of the players.
Any suggestion?

I haven't really done any animation using Java. But, I do know that if you want to have some sort of transparency to your images (i.e. to show only the image of the soccer player), you won't be able to use JPEG's.
You'll have to use a format that supports transparency like GIF's.

Similar Messages

  • Once I create a html5 animation using the 'Toolkit for CreateJS' in flash, how do I then insert it..

    Once I create a html5 animation using the 'Toolkit for CreateJS' in flash, how do I then insert it into a webpage via Dreamweaver:
    This has been sending me round in circles for over a week - can anyone let me know how I do this or can they point me in the direction of a tutorial?  Thank you in advance - d;-)

    There are some tutorials on Adobe site:
    <http://www.adobe.com/devnet/createjs/articles/getting-started.html>
    <http://tv.adobe.com/watch/adc-presents/toolkit-for-createjs-part-1-designing-game-assets/>
    <http://tv.adobe.com/watch/adc-presents/toolkit-for-createjs-part-2-adding-game-interactivi ty/>
    The parts 1 and 2 are videos about 10 minutes each while the first link is a detailed article that you can print and practice on your machine.
    Hope this helps.

  • Builiding animations using FXML or the Scene Builder in javaFX

    please i wanna know if its possible building user interfaces with dynamic nodes or animations using FXML or the Scenebuilder in JavaFX
    Elikem.

    HI,
    Currently SceneBuilder is still a baby v.1.x You can only create nodes and make some graphical , layout, stylesheets changes on them. The animation can't be done from the FXML so Scenebuilders dont have these concepts. You will need to have hard code for this. But I still think SceneBuilder is far more Flexible,fast and easy to build javafx application.
    Thanks
    Narayan

  • I am a new using Adobe products, and I am creating an Animation using Edge Animation.....

    Hi guys.
    As I said, I am new working with Adobe products, like Dw, and now I am creating an animation using Edge Animation.
    Actually, I am creating a carrousel with different pictures representing three different apps being displayed from different devices, moving them and creating a simulated
    movement for each one, based  on the functionality, that action should be activated by a button (i.e.) titled "Inventory", the action to execute is to move
    the three related screens ( Desktop, Ipad and Iphone ) from the original position  to the middle screen, but at the same time, and this is what I need to know,
    If there is another set of screens for a different application, how to move those back to the original position, before moving
    the selected one, "Inventory". I tried to use a duplicated transition and inverting, it works, but it doesn't stop waiting for a new action, and how to combine
    that movement back with the selected app-transition?
    I put  two screenshots with the stage and the original position for all of them. I have not created the buttons yet. I imagine I should use some kind
    of conditional statements to execute the action sending back  those elements  located in the middle  of screen, because were selected before,
    and then execute to animation to move the selected app.
    I would appreciate your help on this matter.
    Thanks.
    Gustavo Hevia
    original Position.
    After the First animation for Inventory App.

    No answers, Ok.
    I will try to give you more information about I want to do.
    I am a Filemaker Developer, and I started creating my webpage, and one of thing I would like to do is this
    animation and put it on my website.
    What I want is to simulate a carrousel of options to show the selected application using the three buttons,
    Now, I put the three buttons and each one of them is moving the three corresponding applications, that's fine.
    But the issue I have :
    I am using Mouseover and Mouseout to show a different color and size of the buttons, and to execute the
    corresponding animation.
    For each event I created different labels : Inventory_hover ; Inventory_mouseover ; Inventory_Animation and
    Inventory_Animation_Reverse and so on.
    Testing that
    After I selected one of them, and it ended moving the three pictures to the center of the screen, and then I
    leave, the three screens moved to the original position, which is not a bad idea, but I want to control that
    moving.
    So, what I want as a summary is :
    1) to control that back movement. I was trying to figure out how to add some code inside the Animation code, and
    just before execute that animation, check if there is another application selected before, and then move that
    set of pictures back to the original position, since I have only three applications pictures, and only one can move
    at the time, the checking "If Statements" would be for two others conditions.
    2) That should be done only when one of the buttons is clicked, and not when the mouse leaves the buttons like it
    is happening now.
    I attached a zip file with my EA files.
    Thank you in advance, Any help would be really appreciated.

  • Problems with animations using key frames and other bugs

    To me, the current version of Acrobat 3D Toolkit (7.0.7) seems like a beta version -- unfortunately I payed the full price. Or maybe there are a few settings only set wrong on my system and someone can tell me how to correct this ...
    ++ Animations using key frames
    According to the manual page 86:
    <-----
    6. Ensure the time/frame line is positioned at frame 0, right-click over the time/frame line in the timeline, and then click Insert Key.
    ---->
    I cannot get this context menu option (see http://www.vornweg.de/acrobat3d/no-insert-key-option.gif )
    ++ Empty and hence almost useless Animations Options dialog
    The Animation Options dialog does not list any Sequence entries -- although there are sequences available, see http://www.vornweg.de/acrobat3d/empty-animation-options-dialog.gif.
    ++ Mixed up icon bars
    Moving icon bars around can result in a complete mix-up of unusable icons, see http://www.vornweg.de/acrobat3d/mixed-up-menus.gif
    ++ Functionless Object Position toolbar
    The object position cannot be set using the Object Position toolbar, the OK icon is deactivated all the time although the tick icon is darker green, i.e. supposedly active (see http://www.vornweg.de/acrobat3d/position-panel.gif
    ++ Missing things
    Why is there no properties panel visible all the time, displaying the properties of the selected object and allowing to change properties (e.g. positions, angles etc.)?
    Why is it impossible to view different trees at the same time (e.g. scene tree and animation tree)?
    Why is it impossible to have different models open simultaneously? (E.g. to compare settings or even to copy properties/objects from one model to the other.)
    Why is it impossible to create new folders in the scene tree? Imported folders are available, but for the scene management within Acrobat 3D I may have different requirements than the CAD designer had. (Also, I would like to put new objects in folders of my own.)
    Why is tabbing not supported more extensively? E.g. All the different trees (Folders, Scene Tree, ...) could all be put into a single tabbed panel saving valuable space on my screen but still giving easy access to all items.
    Why is there no Undo for camera position changes?
    Why is there no Undo for material edits (e.g. applying a new material to an object)?
    Why is it only possible to animate object movements, not the making visible/invisible of objects and changes of the camera position?
    Why is it impossible to save object selections? Within a larger model it always is a lot of clicking to get the view required for certain actions.
    Why are there a lot of different Display options available on-screen but when a scene is rendered into a file, Acrobat 3D uses the same display option all the time (i.e. Solid)?
    Probably this list could be extended quite heavily. And some of these missing things may be time intensive to realize (and saved for future versions), others are comparably basics now-a-days.

    I agree with the "beta" feel of the 3D Toolkit. I have been very frustrated getting animation to work well. Specifically, I made an animation that plays in Toolkit, imports and plays into Acrobat 3D, but does not play in Reader. It displays 3D and rotates, etc., but I cannot get the animaiton to play.
    The contextural menu issue you see I see also. The menu appears, but without the "add Key Frame" item. I find that if I select an object, move it a bit, move it back, then the menu will appear. (at least sometimes I think) Pretty frustrating.

  • I need to make a stop start animation using iMovie. I need the time factor to be 0.03. Every time I make an adjustment it goes to 0.1s which is too slow. Does anyone have a suggestions?

    I need to make a stop start animation using iMovie. I need the time factor to be 0.03. Every time I make an adjustment it goes to 0.1s which is too slow. Does anyone have a suggestions?

    First, for Stop Motion Animation, there are better tools. These include iStopMotion and QuickTIme Pro Version 7.
    If you want to do it in iMovie, it is possible, but slow.
    First, go into iMovie Preferences, and make sure you check "Display Time as hh:mm:ss:frames". This will let you edit to the frame lever rather than to the nearest 10th of a second.
    Second, see this Tutorial by Jon Walker on how to edit down to a single frame in a still image sequence.
    You can modify his technique to get 2 or three frames.

  • Exporting an animation using save for web

    I am trying to export my animation as a GIF using save for web but when I try saving it gives me an error message saying: "Could not complete this operation. an unknown error has occurred." I am using Photoshop CC 2014.

    I am on windows 8, The document is a PSD of course. It's a app UI animation using mostly smart objects and a timeline for the animations. My save options were:
    reduction algorithm: Selective
    Dither algorithm: pattern
    No transparency dither
    Color: 128
    Dither: (Blank)
    Matte: (Blank)
    Web snap: 0%
    Preview: Monitor color
    Metadata: Copyright and contact info
    Percent: 100%
    Quality: Bicubic  smoother
    Looping options: forever

  • Search animation using labview

    Hi does anyone here in this furom try to create/already did an animation using labview.. or a busy animation to front panel.. can you give me an idea on how to do and what to do?..
    for example a magnifying glass moving that indicates searching for something..or a busy cursor on front panel thanks in advance
    Thank you & Best regards
    syrpimp
    =======================================================
    “You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley

    Hi syrpimp,
    by using a search function you will find examples for such animations…
    Hint: use a picture ring!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Is there a fix for a problem with animation using nested graphics (parent/child)?

    I am not sure if its because of my lack of experience with 2D programs or not, however I am having issues with nested graphics and animation. I am normally a 3D user and as such grouping and parents are very key to how things are able to move. The problem I am having (just as an example because its hapening in multiple areas) is I have an arm of a character that is grouped 3 times. The upper arm is the parent, the lower arm is grouped inside the upper arm, and the hand grouped inside that, all of which were converted to graphics. I did this so the lower arm and hand follow the upper arm, and the hand follows the lower arm. This would be a common sense thing to do in 3D however when it comes to animating the hand, usually when double clicking a graphic it takes you to the same frame for the child as is selected with the parent (if the parent is on frame 20, double clicking the parent should take you to frame 20 of the child). I should also add that all graphics have the same frame count.  The problem being when i double click, the child does not have the same frame count and throws off everything done to the child in relation to the parent's animation. I am not sure if its something i did, or a problem that exists inside flash. I have a deadline coming up and this has been a bad problem to have last minute so if anyone has advice on the matter, that would be greatly appreciated!
    I also tried using the bone tool in flash, and besides no obvious way of re-adjusting the bones that are attached to the graphics (short of deleting them and trying again), this was difficult as well. I looked up ways to adjust the position and it seems you can only adjust the graphics themselves, not the bones. Normally this wouldn't be a big deal if it didn't start skewing the graphics out of place randomly. 
    I hope this isn't too confusing and I would certainly appreciate some feedback!

    Would you mind reposting this question over on the Flash Professional forums?  This forum is primarily for end users, the Pro forums will get you in touch with a wider developer audience.
     

  • Exporting animation using Save for Web and Devices problem

    The animation plays as it should when the "Play" button is pressed at the bottom of the "Save for Web and Devices" Menu , but when I Preview it the individual frames don't disappear once they've shown , so you can see them all at the end of the animation . This is also how they save as a .gif ( although using the "Save as html" option reverts to looking as it should , each frame appearing and disappearing in turn) How do I save as gif without this happening?Many thanks for any help

    Thanks!  It was under the object - slice.  You've saved my sanity

  • Remaining quality of stop motion animation using jpeg photos in i-movie

    Creating an animation in i-movie using photos in jpeg-format from i-photo, I would like to know if the quality of the jpeg-photos inserted into the i-movie-film-line remains the same during the process working with i-movie.
    Can I save the photo-data inserted into the i-movie film-line several time without its quality becoming less and less?
    Thank you for your help!
    Annettli

    Annetti
    Welcome to Discussions.
    iMovie saves your media ( video, stills, audio) as imported. When you save a project you are saving the instructions you have given iMovie. The media is kept intact.
    Peter

  • Problems with basic Java JPanel animation using paintcomponent

    okay so I am trying to animate a sprite moving across a background using a for loop within the paintComponent method of a JPanel extension
    public void paintComponent(Graphics g){
    Image simpleBG = new ImageIcon("Images/Backgrounds/Simple path.jpg").getImage();
    Image mMan = new ImageIcon("Images/Sprites/hMan.gif").getImage();
    if (!backgroundIsDrawn){
    g.drawImage(simpleBG, 0, 0, this);
    g.drawImage(mMan, xi, y, this);
    backgroundIsDrawn=true;
    else
    for (int i=xi; i<500; i++){
    g.drawImage(simpleBG, 0, 0, this);
    g.drawImage(mMan, i, y, this);
    try{
    Thread.sleep(10);
    } catch(Exception ex){System.out.println("damn");}
    The problem is that no matter what I set my thread to, it will not show the animation, it will just jump to the last location, even if the thread sleep is set high enough that it takes several minutes to calculate,, it still does not paint the intemediary steps.
    any solution, including using a different method of animation all together would be greatly appreciated. I am learning java on my own so i need all the help I can get.

    fysicsandpholds1014 wrote:
    even when I placed the thread sleep outside of the actual paintComponent in a for loop that called repaint(), it still did not work? Nope. Doing this will likely put the Event Dispatch Thread or EDT to sleep. Since this is the main thread that is responsible for Swing's painting and user interaction, you'll put your app to sleep with this. Again, use a Swing Timer
    and is there any easy animation method that doesnt require painting and repainting every time becasue it is very hard to change what I want to animate with a single paintComponent method? I don't get this.
    I find the internet tutorials either way too complicated or not nearly in depth enough. Maybe its just that I am new to programming but there doesn't seem to be a happy medium between dumbed down Swing tutorials and very complicated and sophisticated animation algorithmns.I can only advise that you practice, practice, practice. The more you use the tutorials, the easier they'll be to use.
    Here's another small demo or animation. It is not optimized (repaint is called on the whole JPanel), but demonstrates some points:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.image.BufferedImage;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    @SuppressWarnings("serial")
    public class AnimationDemo2 extends JPanel {
      // use a publicly available sprite for this example
      private static final String SPRITE_PATH = "http://upload.wikimedia.org/" +
                "wikipedia/commons/2/2e/FreeCol_flyingDutchman.png";
      private static final int SIDE = 600;
      private static final Dimension APP_SIZE = new Dimension(SIDE, SIDE);
      // timer delay: equivalent to the Thread.sleep time
      private static final int TIMER_DELAY = 20;
      // how far to move in x dimension with each loop of timer
      public static final int DELTA_X = 1;
      // holds our sprite image
      private BufferedImage img = null;
      // the images x & y locations
      private int imageX = 0;
      private int imageY = SIDE/2;
      public AnimationDemo2() {
        setPreferredSize(APP_SIZE);
        try {
          // first get our image
          URL url = new URL(SPRITE_PATH);
          img = ImageIO.read(url);
          imageY -= 3*img.getHeight()/4;
        } catch (Exception e) { // shame on me for combining exceptions :(
          e.printStackTrace();
          System.exit(1); // exit if fails
        // create and start the Swing Timer
        new Timer(TIMER_DELAY, new TimerListener()).start();
      // all paintComponent does is paint -- nothing else
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.blue);
        int w = getWidth();
        int h = getHeight();
        g.fillRect(0, h/2, w, h);
        if (img != null) {
          g.drawImage(img, imageX, imageY, this);
      private class TimerListener implements ActionListener {
        // is called every TIMER_DELAY ms
        public void actionPerformed(ActionEvent e) {
          imageX += DELTA_X;
          if (imageX > getWidth()) {
            imageX = 0;
          // ask JVM to paint this JPanel
          AnimationDemo2.this.repaint();
      // code to place our JPanel into a JFrame and show it
      private static void createAndShowUI() {
        JFrame frame = new JFrame("Animation Demo");
        frame.getContentPane().add(new AnimationDemo2());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      // call Swing code in a thread-safe manner
      public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
            createAndShowUI();
    }

  • Animation using JavaScript

    Hi,
    I have created an animation exercise for an eLearning lesson in a program that uses JavaScript as the scripting for a Windows executable. A retired social worker who creates these eLearning materials as give-away's to help people in the community improve health, it would be a big help to reaching more people if instead of a Windows executable version, the animation could be developed in a web page. A lot more people could view the eLearning and try this exercise which trains people in pacing their breathing.
    The animation has a 300X300 circle on the canvas with a couple of text input boxes and a start button. The JS < 50 lines of script, but since it was not developed for a web page, it has no tags and it depends on objects like the circle or button (or 2 audio files to craete the inhale/exhale sounds) that were already placed on the canvas in the Windows executable program.
    I'm not very skilled using Dreamweaver CS5, but with help, reading, references can try to convert this JS into a web version, if it's possible. Not sure how to do this and would appreciate any help.
    I am adding a screenshot of the interface and the JS functions that are called by the start button.
    //JS: ( bar1 is the variable entered by the use as breaths per minute-BPM; time1 is the exercise length; the variables initially are set as follows: time1=15, //volume=100)
    var time1
    function minuteTimer()
    breakLoop = false
    stopLoop = false
    fork (calcBreathing)
    for (var i=0;i<time1;i++)
        wait(60)
        breakLoop = true
        Submit.Show()
        Text122.Show()
        Text12.Show()
        TextInput22.Show()
        TextInput2.Show()
        Submit2.Hide()
        TextInput2.SetTransparency(0,false)
        TextInput22.SetTransparency(0,false)
        Text12.SetTransparency(0,false)
        Text122.SetTransparency(0,false)
        Text5.SetTransparency(0,false)
        Frame12.SetTransparency(0,false)
        Submit.SetTransparency(0,false)
        TextInput2.Enable(true)
        TextInput22.Enable(true)
        Debug.trace("\n minutes elapsed "+(i+1)+"\n")
    stopLoop = true   
    function calcBreathing()
        var bar2 = 60/bar1
        for (loop = 0;loop<bar1;loop++)
            mySound.Play(1,volume)
            Vector8.Scale(.5,.5, bar2*.3)
            mySound.Stop()
            wait (bar2*.05)
            mySound2.Play(1,volume)
            Vector8.Scale(-.5,-.5,bar2*.6)
            mySound2.Stop()
            wait (bar2*.05)
            if (breakLoop) break
        breakLoop = false
        if (bar1 > 6) bar1--
        if (!stopLoop) calcBreathing()
    Any help appreciated. Thanks very much.
    Kind Regards,
    saratogacoach

    joel pau thank you for all the support.
    now i will explain the anwer if anyone else will be stuck with the same problem.
    first of all in edge animate need to mark all the things that created and "convert to symbol"(mark all and right click).
    second:
    in the top of your html file you got the script to the edge_preLoad.js .....
    so now in your js code:
    lets say we use append to add new div to our code and now we got <div id="new"</div>.
    $.Edge.getComposition("yourCompositionID").createSymbolChild("yourSymbolThatCreatedInStepO ne","#new");
    like this you can get new animation of the same composition.
    if you want to conroll the animation you just need to take the id of the new symbol your created using jquery or any way you like.
    and example of control it:
    $.Edge.symbol.get("#theNewID").play();

  • Synchronise symbol animation using Edge Commons

    Hi All,
    I've been trying to animate a PNG sequence that I created with After Effects and Fireworks using the Edge Commons parallax snippet. I'm also trying to make this responsive. I have a vague understanding of the code used so I put together a few other bits and pieces of code I found on these forums.
    The effect I'd like to obtain is to scroll down and synch the animation of the symbols with the scrollbar. Ideally I'd also like to reverse the animation when scrolling down and pull in other symbols but I'm not even sure that this can be done using inline code or actually creating the reversed animation within the symbol.
    I've been trying hard in the past few days but this is where I got so far ;(
    https://www.dropbox.com/s/fr6ygqs16jq11fu/wedding_invite.zip
    Sorry the file is pretty heavy but the png sequences aren't optimised yet.
    Thanks

    Hi Eric ,
    There might be many ways to do the play and play reverse using click operation as described by you but this is what I think could be done .
    We can set a variable in our compositionReady function   sym.setVariable("count", 0);
    Then in the click handler of the symbol we can write the following code
    var x = sym.getVariable("count");
    var mySymbolObject = sym.getSymbol("Symbol_1");
    //Now check if you have clicked once then play otherwise play reverse .
    if(x%2 == 0)
              mySymbolObject.play();
    else
              mySymbolObject.playReverse();
    x++;
    // Set the value of a Symbol variable
    sym.setVariable("count",x);
    Please refer the attached composition . Hope it helps
    Thanks
    Saurav

  • Randomize a Movie Clip Animation Using Actionscript

    I'm new to actionscript.
    I've been working on this sort of sunset-like sequence in
    Flash. I've created a movie clip of a star that has a sort of
    twinkle animation. It consists of 3 layers. What I want to do is
    randomize this animation so I can use the symbol spray tool to fill
    my sky with twinkling stars. If I just to a "gotoAndPlay" repeat,
    they all twinkle at the same time, and this looks pretty stupid.
    My limited knowledge and experience with Actionscript tells
    me that I need to define the animation as a function and use some
    sort of math randomizer to control when it plays?
    I have some books on actionscript I'm yet to work through, as
    this is sort of a hobby of mine that I'm teaching myself, but I
    haven't had the time nor energy to wrap my brain around it yet.
    Thanks for any help!

    Well, I've now decided to only have a few stars twinkling, so
    it's no longer going to be that much of an effort to do a couple of
    different movie clips that twinkle at different periods of time. I
    just had the brilliant idea to do constellations that highlight and
    serve as the button navigation for my portfolio website, and I plan
    to have it seem like your panning up above the horizon and looking
    up into the sky, and having about a hundred twinkling stars moving
    and twinkling at the same time would probably prove super taxing on
    most computers lol...
    I'd still like to hear from anyone who may know how to do
    this as it would still come in handy to me.

Maybe you are looking for