rounded walls to keep ball actor inside screen

insaneyeinsaneye Member Posts: 7
edited May 2012 in Working with GS (Mac)
hi all

I'm trying to workout how to make walls around my screen that are curved like the top corners of say a pinball machine, I've tried adding blocks at angles but its just messy and when the ball hits it just not right,
would i have to make a curved wall shape in photoshop and import it ?

thanks

insaneye

Best Answer

  • UtopianGamesUtopianGames Posts: 5,692
    Accepted Answer
    You could use a circle if its for a corner...in the physics/collision shape part of the actor you can change it to a circle.

    Or you can do what we did in Bumps and make a few rectangle actors to form a curve, this works well and you don't need as many as you think.



    Darren.

Answers

  • simo103simo103 Member, PRO Posts: 1,331
    edited May 2012
    @insaneye ... you can create the image in photoshop and place it in your scene. Turn moveable off and it will just be there for 'looks'. You will need to place a bunch of small invisible actors (moveable off) along the curved line you want to create. Becuase their physics are off they shouldn't effect performance so you can use a bunch to try for the smooth curve you want. Your ball would collide with them but appear to collide with your photoshopped image.
  • insaneyeinsaneye Member Posts: 7
    thanks simo103 & utopiangames

    Im thinking of creating the corner walls in photoshop, (only prob is I'm useless at photoshop at the moment but slowly figuring it out...) then set it to alpha 0, not moveable, restitution 1, and place them at the boundary walls of the game making it look like the ball bounces of the wall in the background i am using, i was hoping that there was a way of creating a curved line with GS just like you can with a straight wall/floor actor

    insaneye
  • simo103simo103 Member, PRO Posts: 1,331
    @insaneye .. anything that is hidden behind another actor or is going to have alpha set to zero .. don't create an image in photoshop for as it will be unseen and will only add image size to the scene and increase load times. Just create a spare actor in GS drag it in your scene and set its alpha to zero. (Tip: I often set its color to one that I might use for walls for example ... but put a change attribute self.color.alpha to zero in it so I can easily see it when building/editing the scene but the change attribute will make it invisible when the game is previewed and played)
  • insaneyeinsaneye Member Posts: 7
    thanks

    yes I've just reset various small walls into angles to create the corners and it seems to work fine this time i must have been doing something wrong earlier....

    great tip on the ''change attribute self.color.alpha to zero'' so i can see where I'm placing them whist building

    great forum thanks
  • MotherHooseMotherHoose Member Posts: 2,456
    @insaneye … you got great advice from @UtopianGames and @simo103

    those small invisible actors take so little bytes and work beautifully

    and you do not need walls around the scene to keep the ball in the scene:
    demo: http://www.mediafire.com/?kjamvsy3diubq4k

    image MH
Sign In or Register to comment.