Jump to content
  • Advertisement

Marko T

Member
  • Content Count

    15
  • Joined

  • Last visited

Everything posted by Marko T

  1. C:\Users\Marko\Desktop\java>java rtype.RType Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException         at javax.swing.ImageIcon.<init>(Unknown Source)         at rtype.Missile.<init>(Missile.java:21)         at rtype.Craft.fire(Craft.java:106)         at rtype.Craft.keyPressed(Craft.java:85)         at rtype.Board$TAdapter.keyPressed(Board.java:228)         at java.awt.Component.processKeyEvent(Unknown Source)         at javax.swing.JComponent.processKeyEvent(Unknown Source)         at java.awt.Component.processEvent(Unknown Source)         at java.awt.Container.processEvent(Unknown Source)         at java.awt.Component.dispatchEventImpl(Unknown Source)         at java.awt.Container.dispatchEventImpl(Unknown Source)         at java.awt.Component.dispatchEvent(Unknown Source)         at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)         at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour ce)         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Sour ce)         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)         at java.awt.Component.dispatchEventImpl(Unknown Source)         at java.awt.Container.dispatchEventImpl(Unknown Source)         at java.awt.Window.dispatchEventImpl(Unknown Source)         at java.awt.Component.dispatchEvent(Unknown Source)         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)         at java.awt.EventQueue.access$000(Unknown Source)         at java.awt.EventQueue$3.run(Unknown Source)         at java.awt.EventQueue$3.run(Unknown Source)         at java.security.AccessController.doPrivileged(Native Method)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour ce)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour ce)         at java.awt.EventQueue$4.run(Unknown Source)         at java.awt.EventQueue$4.run(Unknown Source)         at java.security.AccessController.doPrivileged(Native Method)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour ce)         at java.awt.EventQueue.dispatchEvent(Unknown Source)         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)         at java.awt.EventDispatchThread.run(Unknown Source) I get this error when i pres space in my game. I had a major screwup, i accidentally deleted the orginal .java files, but i recreated them. But for somereason shooting stopped working. Each time when i press space i get this message in console.
  2. I made a class for pixel perfect collision, but for it to work, i must send the entire object to it. How can i pass an entire object to a function. whati s the general name for objects, like integrals have int and so on. Or how can i send the specific part of the spritesheet to the function. Im using imageicon to draw the images on the board , adn all the movement and stuff is done with image icons. So how to i send objects ingonito or how i send parts of imageicon?
  3. Marko T

    strange error

    I see. i found the error. Grammar mistake in the .png file name :D
  4. Marko T

    Hitbox on irregular objects

    Can i do pixel perect collision with imageicon or do i need to use buffered image?
  5. How to i create a hitbox for irregular objects.
  6. Marko T

    Hitbox on irregular objects

    Or do you have a better suggestion for getting the x and Y coords, cause manually getting em would be quite hard and my monster also moves around
  7. Marko T

    Hitbox on irregular objects

    OK. i think i can use the polygon. is there a way to automatically get the X and Y coordinates for my shape or do i have to get em manually?
  8. Marko T

    Hitbox on irregular objects

    so basiclly, the more precise hitbox i want the more sections i mustm ake
  9. Marko T

    Hitbox on irregular objects

    Im using the standard JDK. and ima lasousing java swing. Im trying to accoplish thet i can shoot through the tenticles to hit the eye. Atm it jsut hit the rectangle edge that surrounds the creature. [sharedmedia=gallery:images:3637] Hitbox for this
  10. Marko T

    Boss4

    From the album: Learing to make a game

  11. Marko T

    Learing to make a game

  12. Solution to this problem wasnt in this code. It was in the drawing function that made the clitch. I entered the wrong number of frames there and it clitched out. And the oder problem was in the oder of lines. I had to re arrange thel ines and it worked.
  13. public int getFrame(){                  if(aeg % 60 == 0){             if(frame == 0){                 beforeframe = frame;                 frame +=1;                 }         }         if(frame != 0){                     if(frame == 1){                 if(aeg % 30 == 0){                     if(beforeframe == 0){                         beforeframe = frame;                         frame +=1;                         }                     if(beforeframe == 2){                         beforeframe = frame;                         frame -=1;                         }                 }             }             else if(frame == 2){                 if(aeg % 30 == 0){                     if(beforeframe == 1){                         beforeframe = frame;                         frame +=1;                         }                     if(beforeframe == 3){                         beforeframe = frame;                         frame -=1;                         }                     }                 }             else if(frame == 3){                 if(aeg % 30 == 0){                     if(beforeframe == 2){                         beforeframe = frame;                         frame +=1;                         }                     if(beforeframe == 4){                         beforeframe = frame;                         frame -=1;                         }                     }                 }             else if(frame == 4){                 if(aeg % 30 == 0){                     beforeframe = frame;                     frame -= 1;                     }                 }         }                  aeg += 1;         if(aeg == 61)             aeg = 0;                      return frame;     }   This is my frame selecter code, but it doesent seem to work right. This control eye blinking. speed is easy to adjust just change the values of time and its ok. But the problem is frame selection. It seem to jump over some frames and leave other frames out. and it also dissapears randomly. what could be the problem?
  14. I realised how dumb i am and found my problem :D. So how to i delete this topic?
  15. Sending the attributes isnt a problem. i just want to animate the movement and i had an idea with the frame switching, but it had to be built in the object. Now i need to think up a differetn way to change frames.
  16. Im trying to make a simple game. I have the basic understanding of spreadsheet and the coding itself, but im havign problems now and then. Can i place the drawImage function in my object class so that i can return it anywhere i want. example. Boar.java has a line if(boss.isVisible()) boss.drawBoss(); adn the Boss.java has this   public Image drawBoss(){ Graphics g Graphics2D g2d = (Graphics2D)g; return g2d.drawImage(.....) }   So how to i make this work???  
  17. So, as i understand, all the painting must be done int that one function, but i can send all the attributes to it.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!