Collision

triton13triton13 Member Posts: 161
edited February 2012 in Working with GS (Mac)
If I have a few circles, how can I get them to collide and roll off of each other? I tried it and when they collide, it's like there's an invisible barrier that they hit before they are even close to each other and just roll off of that.

Comments

  • triton13triton13 Member Posts: 161
    Okay, I think I might have figured it out but I still need help fixing it. When I'm not previewing it, I click on my circle and it has a large box around it where I would adjust the size of it. I think that is the invisible barrier because I have kinda had a problem with this before and I don't know how to fix it. Please help. Thank you =)
  • App SurgeApp Surge Member Posts: 651
    Change the collision shape to circle, under the actor attributes. Also make sure that the image is cropped to the edges of the circle.
  • triton13triton13 Member Posts: 161
    I already had it changed to circle but what do you mean make sure it's cropped to the edges?
  • App SurgeApp Surge Member Posts: 651
    If your image is... say... 100x100 but only 90x90 of that space is being used (it has an empty border around it) crop out the 10x10 that isn't being used.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If the image used for the actor has white space around it instead of a transparent background, the collision size will be larger than you'd expect. Open the image in a graphic editor (e.g. Preview: http://www.ehow.com/how_2126752_images-preview-mac-osx-leopard.html) and crop out the extra space so that the dimensions of the image file are exactly the size of the artwork.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • triton13triton13 Member Posts: 161
    I had a transparent background when I made it in photoshop. Once I added the circle in GS and put the image up, it made my image into an oval when I added it too the scene. So to fix that, I tried to resize it by clicking it and dragging the square.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    As @redsky said, you have to do this in an image-editing program, not in GameSalad. Open the image in photoshop and crop it as close to the actual artwork as possible. Resave and re-import into GS.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • CloudsClouds Member Posts: 1,599
    @triton13

    Don't drag your oval to make a circle . . . double click on it and then in the left hand panel that pops up make sure its X and Y dimensions are the same . . . you can simply do it by eye by dragging the 'handles' but it's quicker and more accurate to double click and change the numbers.
  • triton13triton13 Member Posts: 161
    When I have it in photoshop and it's the same size, there are still little edges on the circle. Won't that make it so it's like an invisible square around the circle?
  • triton13triton13 Member Posts: 161
    What do you mean the X and Y. I don't see that anywhere except for the position. Please excuse my noobness lol
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @triton13

    "What do you mean the X and Y. I don't see that anywhere except for the position."

    X dimension means width.
    Y dimension means height

    "When I have it in photoshop and it's the same size, there are still little edges on the circle. Won't that make it so it's like an invisible square around the circle?"

    Yes, any area you make transparent ("invisible") in Photoshop will be transparent in Gamesalad.

    But when it comes to detecting collisions Gamesalad doesn't care if a part of the image is green, blue, transparent, purple or yellow and brown stripes . . . . all it can see is a square file, that's what it will use to bounce of other stuff . . . . the only other option you have is to make the collision area circular . . . that's it, a square or a circle.
  • triton13triton13 Member Posts: 161
    I did everything you guys said but when I click on the ball when it's in the scene, that stupid resize square is still around it and it pretty much takes up the whole screen. I had my ball and saved it with a transparent background and there were just the tiny little edges on it. I made the collision area circular and still nothing. I have no idea what I'm doing wrong but it's starting to frustrate me =/
  • triton13triton13 Member Posts: 161
    I made my ball in PS and it fits in a 30x30 pixel square. I open up GS and make it an actor. I then drag it into the scene and it's huge with a huge square around it. I check the size and it freaking says, 320x480. Why is there an edit the size square that's as big as the iPhone screen?
  • CloudsClouds Member Posts: 1,599
    @triton13

    "I made my ball in PS and it fits in a 30x30 pixel square. I open up GS and make it an actor. I then drag it into the scene and it's huge with a huge square around it. I check the size and it freaking says, 320x480. Why is there an edit the size square that's as big as the iPhone screen?"

    Make sure when you are in Photoshop that your image is 72 ppi.
  • CloudsClouds Member Posts: 1,599
    @triton13

    >". . . when I click on the ball when it's in the scene, that stupid resize square is still around it . . . . "

    You can't get rid of the resize square.

    >"I made the collision area circular and still nothing."

    What were you hoping would happen ?
  • triton13triton13 Member Posts: 161
    I just want the ball to be able to roll around and collide with other balls. I'm not home right but I'll try the PS thing later. When I look at the cannon game in GS in the top row, I clicked on that ball and the resize square is really close to the ball.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "I just want the ball to be able to roll around and collide with other balls."

    Draw a circle in Photoshop, make sure the circle goes right up to the edges of the file, make sure the file is 72 ppi, import it into Gamesalad and then make sure the collision shape is set to circle.

    It really is as simple as that.

    "I clicked on that ball and the resize square is really close to the ball."

    Great, that's how it should be, is there a reason you are telling us this ?

    8-X

    Here, I have made you a file . . . http://www.mediafire.com/?m4vfrf2m0slmefa

    In this zipped archive is one Gamesalad file and one Photoshop PNG, drag the PNG onto Photoshop to see what your file should look like when you are making it in Photoshop - check the Image Size to see that it is set to 72 ppi.
  • triton13triton13 Member Posts: 161
    The reason why I told you that it's close to that ball is, I don't know how they got it so close. Mine isn't close like that at all. The collision shape is on circle and the ppi is 72. I'm getting ready to download that file right now. I'll let you know how everything turns out and I really appreciate you putting up with me. Thank you =)
  • triton13triton13 Member Posts: 161
    Alright man, I figured out my problem. Thank you so much for helping me out. This really means a lot. You were very helpful =) Thanks =D
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @triton13

    "Alright man, I figured out my problem. Thank you so much for helping me out."

    No problem, it will all get easier and more obvious the more you play around with Gamesalad.

    Just so others can learn from your issue . . . . what was the problem in the end . . . ?
  • CloudsClouds Member Posts: 1,599
    "The reason why I told you that it's close to that ball is, I don't know how they got it so close"

    Gamesalad will always put it's resizing box exactly on the edge of your imported file, so the way they got the resizing box so close was to make their circle image as wide and as tall as their canvas in Photoshop.
  • triton13triton13 Member Posts: 161
    My problem was, I was being stupid and didn't delete the old picture of the ball and replace it with the new picture after I had fixed the ball. It was a stupid mistake but I hope no one else does the same thing as me.
Sign In or Register to comment.