Problems with Graphics and a Timer...

Alright so what I'm trying to do is when my character attacks (after the user pushes the ctrl button) I want the attack sprite to show, along with a simple slash graphic, then after less than a second I want the graphic gone and the sprite to return to standing mode. the problem is that it doesn't return, it just stays with the graphic and the attack sprite until the user moves.
here's the attack sub
        public void attack(){
                at=true;
                udchar(3,"attack1");
          sleep(300);
          repaint();
        }here's my sleep sub
        public void sleep(long l){
                try{
                        Thread.sleep(l);
                catch(InterruptedException e){
                        return;
        }and here's my paint sub
        public void paint(Graphics g){
                bufferGraphics.drawImage(background,0,0,10000,600,this);
                bufferGraphics.drawImage(sidebar,720,0,200,600,this);
                bufferGraphics.drawImage(chara,px,py,128,128,this);
                bufferGraphics.drawImage(sworda,px,py,128,128,this);
                bufferGraphics.drawImage(hi,6,507,96,96,this);
                bufferGraphics.drawImage(li,200,507,96,96,this);
                bufferGraphics.drawImage(mi,394,507,96,96,this);
                if(at==true){
                        if(dir.equals("right"))
                                bufferGraphics.drawImage(slice,px+100,py+20,128,128,this);
                        else
                                bufferGraphics.drawImage(slice,px-100,py+20,128,128,this);
                        at=false;
                g.drawImage(offscreen,0,0,this);
        }Help would be much appreciated. I'm not sure if I need to include any other parts of my code or not. If I do just let me know and I'll post that part of the code when I get home from work. Thanks in advance.

There are a variety of Graphics forums that can provide the specialized help you need though, such as Java2d and Java3d, about 1/3 of the way down the forum list.

Similar Messages

  • Problem with DAQmx and Real Time PCI-7041/6040E.

    Problem with DAQmx and Real Time PCI-7041/6040E.
    I have a problem with the Real Time card PCI-7041/6040E, I think it is properly installed because my software run with the traditional NI-DAQ. When I try to use the new DAQmx to acquire one signal, Labview doesn't see any device for de DAQ card 6040E.
    Information, I work on Windows XP and LabView v7.0.0 (NIDAQ RT v7.0.0, NI-Serial RT v2.5.2, NI-VISA v3.0.1 and NI-Watchdog v2.0.0).
    Could Labview RT run with new DAQmx ?
    What can I do to use DAQmx with PCI-7041/6040E?
    Thanks for your help !

    Hello,
    I refer to your posts because i am using the PCI 7041/6040E card as
    well but without any success to make it work. The problem I have
    already described in the following thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=120198
    Would be nice if you had a look on it, maybe you can help me. BTW, the
    thread starts with a problem of someone else, the difficulties I
    encountered are to be found a little bit to the bottom of the thread's
    page.
    Thank you!
    Dirk Völlger
    Darmstadt
    Message Edited by ratschnowski on 07-28-2005 07:14 AM

  • Problems with graphics and Internet connection - iMac 2011 with Lion

    First: sorry about my english... It is terrible! lol
    I have an 2011 iMac, purchased in June 2011 in the USA. I brought the iMac to Brazil.
    Sometimes when I turn on my iMac, the graphics are horrible and can not connect to the Internet. When this happens, I have to restart the Lion.
    Apple introduced the "iMac FW Graphic Update 3.0". The information says clearly that supports Brazilian Portuguese. Butwhen I install, an error appears: "this software is not compatible with your system".
    My Lion is in Brazilian Portuguese. Why it is not compatible? How do I install it? How can I solve this problem?
    Note: The technical assistance of Apple changed the HD, according to recall made ​​by Apple through the site. The HD is new.
    Thank you very much!

    Anybody? I'm buying a new network card simply but I'm not sure that it is the network card that is causing the network problems I'm experiencing.
    Regards
    André

  • Problem with DateDiff and Date/Time value.

    The form below displayed perfectly until I added the line for DateDiff between VacStart and VacEnd. I receive an error message;
    An error occurred while evaluating the expression:
    #DateDiff("w", "VacStart", "VacEnd")#
    Error near line 48, column 51.
    Parameter 2 of function DateDiff which is now "VacStart" must be a date/time value
    The error occurred while processing an element with a general identifier of (#DateDiff("w", "VacStart", "VacEnd")#), occupying document position (48:50) to (48:86).
    I have tried changing the DB value to Date/Time as well as Text and get the same result each time. Any help would be greatly appreciated. Here is my code:
    <cfquery datasource="manna_premier" name="TM_log">
    SELECT *
    FROM TMStatusLog
    </cfquery>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>TM Status Log</title>
    </head>
    <body>
    <p align="center" class="style4">Territory Manager Status Log </p>
    <table width="1448" border="0">
      <tr>
        <th width="71"><span class="style3">ID No.#</span></th>
    <th width="88"><span class="style3"> Date</span></th>
    <th width="166"><span class="style3">TM Name</span></th>
    <th width="129"><span class="style3">Status</span></th>
    <th width="139"><span class="style3">Vac Start </span></th>
    <th width="137"><span class="style3">Vac End</span></th>
    <th width="203">Ttl Days </th>
    <th width="203"><span class="style3">DSR Ride Along Name</span></th>
    <th width="274"><span class="style3">Service Call Name</span></th>
      </tr><cfoutput query="TM_log">
      <tr>
        <td><span class="style3">#ID#</span></td>
        <td><div align="center"><span class="style3">#DateFormat(LogDate, "mm/dd/yyyy")#</span></div></td>
        <td><div align="center"><span class="style3">#TerritoryManager#</span></div></td>
        <td><div align="center"><span class="style3">#Status#</span></div></td>
        <td><div align="center"><span class="style3">#DateFormat(VacStart, "mm/dd/yyyy")#</span></div></td>
        <td><div align="center"><span class="style3">#DateFormat(VacEnd, "mm/dd/yyyy")#</span></div></td>
    <cfif VacStart IS NOT "Null">
        <td><div align="center"><span class="style3">#DateDiff("w", "VacStart", "VacEnd")#</span></div></td>
    </cfif>
        <td><div align="center"><span class="style3">#DSRName#</span></div></td>
        <td><div align="center"><span class="style3">#ServiceName#</span></div></td>
      </tr></cfoutput>
    </table>
    </body>
    </html>

    Error Diagnostic Information
    An error occurred while evaluating the expression:
    #DateDiff("w", VacStart, VacEnd)#
    Error near line 47, column 48.
    Parameter 2 of function DateDiff which is now "" must be a date/time value
    The error occurred while processing an element with a general identifier of (#DateDiff("w", VacStart, VacEnd)#), occupying document position (47:47) to (47:79).
    Any other suggestions? Thanks!
    Well... what does the error message say?
    Parameter 2 of function DateDiff which is now "" must be a date/time value
    What does this tell you?  What is parameter 2 of that function call?  It's VacStart.  So it's saying VacStart is an empty string, and it's saying an empty string is not a valid value for that parameter.
    So the question you need to ask yourself is whether you expect VacStart to be an empty string?  Or do you perhaps expect it to be a date?  I would guess you're expecting it to be a date.  So the question becomes... Why is VacStart an empty string?
    Adam

  • Problems with mouse and showing time

    Hi,
    I wish you can help me how to use the mouse as I have an
    audio and need tje mouse pointer to point at an image
    simultaneously with the audio voice?
    Also I need to show the time (digital time like a clock 1:22
    minutes) simulateanously with the project movie? which starts and
    ends with the audio file ?
    Thanks

    Hi furrey
    oo time show that would create the audio to make an
    application in flash for that, do not understand very well the
    first part, the pointer work simultaneously with the audio that

  • Problem with Graphics and JPanel...

    I would like to draw a rectangle on a JPanel. Here is my code:
    JPanel panel = new JPanel();
    Graphics g = panel.getGraphics();
    g.drawRect(20,20,20,20);
    When I run my program, I have a NullPointerException...
    Do you any suggestions to fix the problem??
    thanks
    Pete

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class pete extends JFrame {
      public pete() {
        JPanel panel = new JPanel() {
          public void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int midx = getSize().width / 2;
            int midy = getSize().height / 2;
            g2.draw(new Rectangle2D.Double(midx/2, midy/2, midx, midy));
        getContentPane().add(panel, "Center");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(400,300);
        setLocation(300,100);
        setVisible(true);
      public static void main(String[] args) {
        new pete();
    }

  • I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the worl

    I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the world of iMac but I find it a bit frustrating trying to solve basic issues/problems:(

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • HT5361 Today, I experienced a problem with my mail. the time and date on each email received and sent is 18-06  and the date is 22nd July irrespective of the actual time

    Today, I experienced a problem with my mail. the time and date on each email received and sent is 18.06 and date as 22nd July. Thank you  John

    Incorrect date or time displayed in various applications

  • Problems with graphics on MacBook Pro / Проблемы с графикой на MacBook Pro

    After updating to 10.7.3 are having problems with graphics (screenshot attached).
    Installing the Combo update did not solve the problem!
    Updating to 10.7.4 did not solve the problem.
    What should be done that would solve the problem?
    /Russian
    После обновления на 10.7.3 возникли проблемы с графикой (скриншот прилагается).
    Установка Combo обновления проблему не решила.
    Обновление до 10.7.4 проблему не решило.
    Что необходимо сделать что бы решить проблему?

    Overheating happens when I use heavy graphics applications. At the moment, MBP cold, but the problem occurred. But if the application is rolled up and open again, the artifacts disappear. The problem occurs 3 ... 5 times a day, which is very annoying. In 10.7.2 before updating to 10.7.3 had no problems.
    MBP 13" (mid 2010)
    /russian
    Перегрев бывает, когда я использую тяжелые графические приложения. В данный момент MBP холодный, но проблема произошла. Но если приложение свернуть и открыть снова, артефакты исчезают. Проблема возникает 3...5 раз в день, что сильно раздражает. В 10.7.2 до обновления до 10.7.3 проблем не было.

  • Problem with JFrame and busy/wait Cursor

    Hi -- I'm trying to set a JFrame's cursor to be the busy cursor,
    for the duration of some operation (usually just a few seconds).
    I can get it to work in some situations, but not others.
    Timing does seem to be an issue.
    There are thousands of posts on the BugParade, but
    in general Sun indicates this is not a bug. I just need
    a work-around.
    I've written a test program below to demonstrate the problem.
    I have the problem on Solaris, running with both J2SE 1.3 and 1.4.
    I have not tested on Windows yet.
    When you run the following code, three JFrames will be opened,
    each with the same 5 buttons. The first "F1" listens to its own
    buttons, and works fine. The other two (F2 and F3) listen
    to each other's buttons.
    The "BUSY" button simply sets the cursor on its listener
    to the busy cursor. The "DONE" button sets it to the
    default cursor. These work fine.
    The "SLEEP" button sets the cursor, sleeps for 3 seconds,
    and sets it back. This does not work.
    The "INVOKE LATER" button does the same thing,
    except is uses invokeLater to sleep and set the
    cursor back. This also does not work.
    The "DELAY" button sleeps for 3 seconds (giving you
    time to move the mouse into the other (listerner's)
    window, and then it behaves just like the "SLEEP"
    button. This works.
    Any ideas would be appreciated, thanks.
    -J
    import java.awt.BorderLayout;
    import java.awt.Cursor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class BusyFrameTest implements ActionListener
    private static Cursor busy = Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR);
    private static Cursor done = Cursor.getDefaultCursor();
    JFrame frame;
    JButton[] buttons;
    public BusyFrameTest (String title)
    frame = new JFrame (title);
    buttons = new JButton[5];
    buttons[0] = new JButton ("BUSY");
    buttons[1] = new JButton ("DONE");
    buttons[2] = new JButton ("SLEEP");
    buttons[3] = new JButton ("INVOKE LATER");
    buttons[4] = new JButton ("DELAY");
    JPanel buttonPanel = new JPanel();
    for (int i = 0; i < buttons.length; i++)
    buttonPanel.add (buttons);
    frame.getContentPane().add (buttonPanel);
    frame.pack();
    frame.setVisible (true);
    public void addListeners (ActionListener listener)
    for (int i = 0; i < buttons.length; i++)
    buttons[i].addActionListener (listener);
    public void actionPerformed (ActionEvent e)
    System.out.print (frame.getTitle() + ": " + e.getActionCommand());
    if (e.getActionCommand().equals ("BUSY"))
    frame.setCursor (busy);
    else if (e.getActionCommand().equals ("DONE"))
    frame.setCursor (done);
    else if (e.getActionCommand().equals ("SLEEP"))
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    else if (e.getActionCommand().equals ("INVOKE LATER"))
    frame.setCursor (busy);
    SwingUtilities.invokeLater (thread);
    else if (e.getActionCommand().equals ("DELAY"))
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    System.out.println();
    Runnable thread = new Runnable()
    public void run()
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.println (" finished");
    public static void main (String[] args)
    BusyFrameTest f1 = new BusyFrameTest ("F1");
    f1.addListeners (f1);
    BusyFrameTest f2 = new BusyFrameTest ("F2");
    BusyFrameTest f3 = new BusyFrameTest ("F3");
    f2.addListeners (f3); // 2 listens to 3
    f3.addListeners (f2); // 3 listens to 2

    I've had the same problems with cursors and repaints in a swing application, and I was thinking of if I could use invokeLater, but I never got that far with it.
    I still believe you would need a thread for the time consuming task, and that invokeLater is something you only need to use in a thread different from the event thread.

  • Problems with Safari and Firefox (HTTP?)

    Problems with Safari and Firefox (HTTP?)
    On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
    On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
    On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
    What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
    and
    defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
    but that did not help,
    Nanne

    I'm still wondering why it happens now at this moment in time...
    PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
    It may work when re-enabled

  • Problem with DMGs and error: "No Mountable File Systems"

    Problem with DMGs and error: "No Mountable File Systems"
    The files are not corrupt. The problem is occurring with all DMGs that are apparently formatted in MS-DOS FAT16. No the file will not mount with Disk utility or any other disk mounter programs I have found.
    This is now the second time this occurred and now effects my MBP and my iMac. First time i spent days with Apple support and the only solution was ultimately back up the data, reformat the HD, start over from scratch and reload everything. That lasted about a month before the problem resurfaced and is now an issue on both iMac and MBP.
    I tried to identify all the programs I installed immediately before the error, as I am convinced it is the result of a software conflict.
    Recent programs includes:
    1) upgrading from Parallels 5.5 to 6.0 on both machines.
    2) using an HP secure II usb drive and setting up a secure disk.
    3) installing new itunes 10
    4) new update to Flip For Mac.
    The files affected are downloaded dmgs, including personal brain and google earth, both which are formatted in FAT16.
    Any help or thoughts? Apple has now spent hours trying and they say i now have to reformat and wipe and start over. That is unacceptable and based on pasted experience the problem is likely to repeat itself. having to wipe and rebuild a HD ever month is not an solution. i need to fid the root problem.
    In the meantime, anyone got a real solution on how to extract the data for a DMG using a different method?
    Message was edited by: remaia

    Where you able to find the solution, i am having the same problem, all was fine till i install some programs only same one i saw did we both did was flip4mac i uninstalled it but the problem is still there, i also restored and erased the hardrive but im not up to doing that all over again. If you found anything out let me know i would greatly appreciate it

  • Problem with Rescue and Recovery after installing Norton Internet Security 2010

    Hi all.
    It's my first time in this forum.
    I have a problem, with Rescue and Recovery, after installing Norton Internet Security 2010 on my T43.
    The message I get it:
    "Rescue and Recovery is unable to back up the file 'C:\Documents and settings\all Users\Application Data\ Norton\ 00000082\00000109\000003c1\cltMLS1.bat' Because the file is either corrupted or being used by another application. Please close any application that could be using the file.
    I tried to close the Norton but I couldn't find how.
    Tanks
    Doron71

    Hi and welcome to the forum,
    the reason for this situation is, that the antivir files are protected from being modified.
    This is the reason, why this file cannot be backed up. I assume, that you would get much more such messages, as there are surelly multiple files files, that are protected like this.
    So the solution is to block folders from being archived. Please start RnR application and in the configuration set this folder as the excluded one.
    This will skip the backup of this file and will fix your situation.
    Please let me know, if you have covered this.
    Cheers

  • Problem with ECS and XSD

    Hi B2B Gurus,
    We are facing the problem with ECS and XSD files from past 2 weeks, Steps we followed
    1. Created a ECS file in document editor version 11g: 6.6.0
    2. ECS files consists only from ST and SE segments
    Ex: ST
    BCH
    CUR
    REF
    PER -- Exclude
    TAX -- Exclude
    SE
    3: Generated a XSD file from ECS file( File --> export---> Oracle B2B) in document ediotr
    4. We imported a ECS and XSD file in B2B console( documents---docdef-transaction set ECS file) and XSD File
    5. We tested one file from manually we face below error:
    Error Code B2B-51507
    Error Description Machine Info: (usmtnz-dinfap19.dev.emrsn.org) Description: Payload validation error.
    Error Level ERROR_LEVEL_COLLABORATION
    Error Severity ERROR
    Error Text
    and some times it shows Guideline load Error or simply Error
    Please help us to resolve this
    Regards

    Anuj,
    We are sending the EDI XML file from backend, then B2B will convert it into EDI file, How can we analyze EDI XML file with ECS file, B2B is not converting to EDI.
    1. Can we use 10g ECS file and XSD file in 11G
    2. I tried to import it, but it showing below error while doing testing
    App Message property     {MSG_ID=90422086, Sequencing=false, DOCTYPE_REVISION=5020, MSG_TYPE=1, FROM_PARTY=EMERSON, DOCTYPE_NAME=850, TO_PARTY=APLL, ATTACHMENT=}
    Direction     OUTBOUND
    State     MSG_ERROR
    Error Code     B2B-51507
    Error Text     Error Brief : The element does not include any significant data.
    Error Description     Error : The Element PER02 does not include any significant data characters. Segment PER is defined in the guideline at position 3600.{br}{br}This error was detected at:{br}{tab}Segment Count: 11{br}{tab}Element Count: 2{br}{tab}Characters: 5395 through 5397
    Created Date     06/20/2011 02:52 PM
    Modified Date     06/20/2011 02:52 PM
    Note: I used the same files in 10G its working fine.
    Regards
    Edited by: Francis on Jun 20, 2011 10:48 AM

  • Problem with modules and ModuleLoader

    Hi everybody,
    i'm facing a real funny problem with modules and
    moduleLoader, i hope
    it's not (only) my fault anyway...
    If i create a normal flex project with fBuilder, i'm able to
    use
    modules in a lot of different ways (as mxml, as as in a
    function etc..)...
    but if i try to use them in my fds application (created with
    fds
    eclipse plugin or as a dataServices project) i can't use
    modules. The compile-time error message is
    always the same:
    Could not resolve <mx:ModuleLoader> to a component
    implementation
    I tried a lot of solutions, paying attention to import all
    the classes, to declaration, naming, positioning
    etc...but nothing changes, this thing is drivining me
    crazy!!!.
    I will appreciate anykind of help.
    TIA
    Fabio

    Any idea?

Maybe you are looking for

  • Payment guarantee issue

    Hi, I would like to know what will be the Impact by changing the value in Payment guarantee procedure in Item--> Billing document --> Risk management Tab. and also which modules get affected ? Thanks, KP.

  • Problems with re authentications in a wireless with WLC working with web authentication and a radius server

    Hi everyone, im having problems in a wireless network, the SSID has security layer 2 WPA, layer 3 web authentication (internal default page), and external RADIUS. When a client makes a roaming from one AP to another one or when he has a idle time, he

  • Repost from soundtrack pro forum: advice needed on how to master a dj mix.

    i posted the info below on the soundtrack pro forum and someone suggested i use waveburner to master my dj mix after it's been recorded: when i record a mix in soundtrack pro, it's 1 long song. sometimes certain parts of the mix come in at a lower vo

  • Software Licence Transfer Debacle

    As we all know we now have to activate our software when we install it. But did you know there are limits on the amount of times you may transfer your license? Now as I understand it, when I purchased my Macromedia software I purchased a license that

  • Configuring DLL in oracle environment

    Hello, I'm using Windows and my Oracle DB version is 9.2.0.1. I want to use DLL (proc & fun) in my pl/sql procedures. What are the steps to configure the DLL in Oracle. Is it same as configuring External procedures? Do we need to configure both liste