Issue with bounding boxes

So I have this actor on my scene, he controls the camera, jumps and move to the right forever... All fine but sometimes he bumps into something invisible, like if i had not aligned well enough the floor (72x72) and if I press jump he'll leap over it and continue but, he does not stops always at the same spot, changing his velocity made him stop at some different spots of the straight line of blocks I made. Do you guys have any idea what my actor is bumping into? I'm sure no invisible blocks are on his way too... anyways thank you in advance :)

Best Answers

  • sparkaniasparkania Posts: 300
    edited January 2013 Accepted Answer
    if it does not appear to be anything obvious, look in the Layers list of things your player is slated to collide with. scroll through them and check each one visibly on the stage. chances are you have an actor on the stage which you may have forgotten about. it might be behind something in your scene making it impossible to select with your mouse.
  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer
    . . . like if i had not aligned well enough the floor (72x72) . . .
    If your floor actors (presumably a tile) are 72 pixels by 72 pixels (and there are lots of them) they are using a relatively large chunk of memory for what they are.

    The smallest chunk of memory you can allocate to a 72 x 72 pixel image is 128 x 128 pixels.

    If they were 64 x 64 they would come to 4,096 pixels.

    At 128 x 128 they are using up 16,384 pixels of memory.

    Basically if you could reduce their size to 64 x 64 you would save around 75% of the memory needed for your (currently 128 x 18 pixel) floor images.

    Hope all that makes sense !
  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer
    ... anyways here is the "test build". http://mavw.tumblr.com/games
    Yes, your floor elements look a little misaligned. Just double click on each one and make sure all the Y co-ordinates are the same.

    (or cut and paste a [Change Attribute - Self.Pos Y to XXXX] into each of the floor actors)

Answers

  • Matheus VilaçaMatheus Vilaça Member Posts: 2
    Hello Sparkania, thank you for your response, I'm pretty sure nothing is behind my actor, I made just a small test, there is just my actor and the floor... anyways, I made a build for web just to see if the build would run ok and for my surprise the blocks are somehow a little misplaced, but in the project file I can see clearly that everything is on place... so, I ran it and it went well, I ran the program a couple more times and most of the times it went well, but still sometimes it bumps into something, I feel like I must be forgetting something simple... anyways here is the "test build". http://mavw.tumblr.com/games
  • Matheus VilaçaMatheus Vilaça Member Posts: 2
    edited January 2013
    Yes, it does makes sense @Socks , thank you! Since I've already opened this post, I'd like to know if there's a more efficient way of building the kind of level i'm going for, I made this straight line because I want to do a platform kinda level, so there'll be a lot more blocks like this to put in place... I can change the size for 64x64 but placing a lot of blocks like this doesn't seem very efficient for me.
  • SocksSocks London, UK.Member Posts: 12,822
    Yes, it does makes sense @Socks , thank you! Since I've already opened this post, I'd like to know if there's a more efficient way of building the kind of level i'm going for, I made this straight line because I want to do a platform kinda level, so there'll be a lot more blocks like this to put in place... I can change the size for 64x64 but placing a lot of blocks like this doesn't seem very efficient for me.
    If it's just a straight line you could use 'replicate'.
  • sparkaniasparkania Member, PRO Posts: 300
    I have a neat way you can find out if your floor is uneven. Just to Test.. Take your player and if possible change him to 'Fixed Rotation' (checked) and then change his collision shape to Circle instead of Rectangle. What this will do is make his contact with the floor rounded. now run him on the floor and see what happens..
Sign In or Register to comment.