Search:

Type: Posts; User: Gravity Games

Search: Search took 0.30 seconds.

  1. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Nevermind, I seem to have figured out the problem. I was neglecting to change where the tiles were drawn in the render method. Apparantly, that's what the Character uses for collision or something......
  2. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    I'm trying to change the position of the objects represented in the arraylist.

    For example:

    In the arraylist, I add a tile at x=100, y=100.
    Then I move the object in the objects coding to...
  3. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Well, I'm trying to affect the arraylist as well as the tiles. How would I do that?
  4. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Here's the code:

    Level:

    package com.gravitygamesinteractive.kylethecaiman;

    import java.awt.*;
    import java.util.*;
    import java.io.File;
  5. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    From what I can tell, its not actually reading from the individual tiles, but from the tile objects in the arraylist. I'm guessing that fixing this either requires rewriting the level format or...
  6. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    That worked! The tiles collision is working perfectly now...when the scrolling is disabled. Unfortunately, for some reason when I scroll the tiles graphics up or down, the collision doesn't move with...
  7. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    I thought that the g.drawRect line is what sets them...
  8. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    I guess that means the width and height is somehow not being set, I could have sworn that I did in the drawRect for it:


    package com.gravitygamesinteractive.kylethecaiman;

    import java.awt.*;...
  9. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    When I pasted your code over mine, it returned this over and over:


    com.gravitygamesinteractive.kylethecaiman.Tile[x=192,y=583,width=0,height=0]...
  10. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Code with the printlines:


    public boolean isCollidingWithFloor(Point pt1, Point pt2){
    for(int f=0;f<Level.tile.size();f++){
    System.out.println(Level.tile.size());...
  11. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    When I use the printline, it correctly shows the number of objects in the arraylist, so that's not the problem. The problem surely has to be the line you said earlier, I must be using the wrong...
  12. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Level.tile is an arraylist of tile objects, and the size value is the number of tile objects in the arraylist. I'm not sure why its not getting called though, as it is referenced in the tick method.
  13. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Yes, as far as I know, that's the problem line. The printline doesn't print anything there either.
  14. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Printlining the points returns a very similar list. However, the Level.tile.get(f) doesn't print at all.
  15. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Here's all the printline results, including the one that prints the y value of the player:


    stageset
    scanset
    Object: 0 At: 10,40
    Object: 1 At: 0,583
    Object: 1 At: 16,583
    Object: 1 At: 32,583...
  16. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Alright, here's the level class:


    package com.gravitygamesinteractive.kylethecaiman;

    import java.awt.*;
    import java.util.*;
    import java.io.File;

    public class Level {
  17. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    Nothing I guess. You think that might be the problem, and if so, how would I fix it?
  18. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    The problem is that the Character object won't stop falling when it touches a ground object. All the printline shows is the y position and that it keeps increasing.
  19. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    The number keeps going on. Also, for some reason the crash doesn't happen anymore, in case that helps.
  20. Replies
    42
    Views
    2,907

    Re: Checking if an object contains a point

    I'm trying to get the player object to stop moving vertically when there is a tile object directly underneath it. The object will not only keep falling, but it also winds up throwing an error when it...
  21. Replies
    42
    Views
    2,907

    Checking if an object contains a point

    Hi, I'm having a little trouble seeing if an object contains a point. Here's my code:


    package com.gravitygamesinteractive.kylethecaiman;

    import java.awt.*;
    import...
Results 1 to 21 of 21