collectable items

zombotszombots Member Posts: 186
edited November -1 in Working with GS (Mac)
can any one help me make my collectible items com from the right of the screen in random places sorta like flutterby if u kno wat i mean

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    spawn actor: x-position = 480+widthofcollectable/2 y-position=random(0,320)

    Make sure you have a little room if you are wrapping on the X axis so you don't see collectables start on the left side.
  • zombotszombots Member Posts: 186
    i dont really understand that, anychance of a screen shot?
  • TobyToby Member Posts: 478
    480 is the number of pixels for a full iPhone screen width plus add the width of your actor eg :50 pixels. This will put your actor off the right side of the screen where you want it to appear from.

    The Y position refers to the height UP and DOWN of the screen and the placement of the actor within this space. The height is 320 pixels.

    So y-position random means your actor can be randomly placed at any pixel between 0 & 320

    Wrapping is a setting in the game attributes, it means when something leaves one side of the screen it appears on the opposite side. Turn this off if you don't want your actor to appear on the Left (remember 480 + 50 example) and then wrap to the right as it scrolls.

    Hope that makes sense
  • zombotszombots Member Posts: 186
    ok i sorta got it going, i dont see them coming from the right but it like im collecting them still coz my score goes up?
    should the actor that spawns the collectable item be scrollable?
    and here is a screen shot is this right?

    http://img80.imageshack.us/img80/299/screenshot20091001at102.png
  • TobyToby Member Posts: 478
    Depends on if your level is a scrolling level or you are just moving the background to imply movement.

    Best approach is to make an animated background that gives the illusion of scrolling then everything else can stay in position and does not need to be set to scroll.

    Easier to upload your test game to the GSalad servers so we can see what you mean.
  • zombotszombots Member Posts: 186
    i have a scrolling scene and the collectible item to appear from the right of the screen as i move that way. i cant upload atm but will later on.
    thanks for the help so far
  • zombotszombots Member Posts: 186
    anyone able to help, i have a scrolling scene and want my spawnd actor to come from the right of the screen as the camera follows my player. or will i have to place them in my scene and not use spawn?
Sign In or Register to comment.