Marko T

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

110 Neutral

About Marko T

  • Rank
    Member
  1. 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?
  2. strange error

    I see. i found the error. Grammar mistake in the .png file name :D
  3. 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.
  4. Hitbox on irregular objects

    Can i do pixel perect collision with imageicon or do i need to use buffered image?
  5. 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
  6. 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?
  7. Hitbox on irregular objects

    so basiclly, the more precise hitbox i want the more sections i mustm ake
  8. 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
  9. Learing to make a game

  10. Boss4

    From the album Learing to make a game

  11. How to i create a hitbox for irregular objects.
  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. I realised how dumb i am and found my problem :D. So how to i delete this topic?
  14. 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?
  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.