4 Questions

InvertedSoftworksInvertedSoftworks Member Posts: 30
edited January 2012 in Working with GS (Mac)
Hi,
When making a reset for a plat former how do i make it where it doesn't reset the scene but it just resets the character?
My second question is when making a level complete screen how do i make that without reseting the scene and just have it slide into view?
My third question is when making the plat former how do i make the controls and pause button scroll with the camera?
Lastly what is resolution independence and what is it used for? (Feel stupid asking this one haha)

Thanks,
Inverted Softworks

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    1.) You want to find the location when your character starts that level.
    Double click on the character actor on level one and on the side you'll see position. Click that and write down the X and Y values.
    Create a new attribute called reset. (Boolean)
    Create a new actor called reset button. Now go into that actor and put this:
    When touch is pressed, change attribute game.reset to true.

    Now go into your character actor.
    Make a new rule:

    When attribute game.reset is true,
    Change attribute: self.positionX to (whatever you recorded at the beginning)
    Do that for self.positionY too.

    2.) Place the Level Complete sign where you want it to show up. Then record the X and Y locations of it. THen move it off the camera view so you cannot see it in the app. Now go into the level complete actor. Whenever you want it to show up, put an interpolate behavior:

    interpolate: self.position X to (Whatever you want)
    Duration: 0.5

    Then another one:
    interpolate self.position Y to (whatever)
    Duration: 0.5


    3.) go into your layers and you must have a layer that isn't scrollable. Put those actors in that layer.

    Hope this helps.
  • InvertedSoftworksInvertedSoftworks Member Posts: 30
    Thanks a whole lot!!
    With the reset button though can i use the same attribute to create the same action when he dies?


    Thanks,
    Inverted Softworks
  • The 'reset character only' solution braydon gave you is just changing the X/Yposition of your character when the button is pressed, so you could easily attach that same behaviour to other situations like you're character dying. obviously though if you attach this behaviour to when your character dies you would also need to specify that along with moving back to the start they also come back to life. if you don't do this your characters dead body would just move to the start of the level.
    This behaviour is also great for when you need your character to 'teleport' somewhere (eg. stepping through a door, portal ect), you just need to change the X/Y position values to the spot on screen you want the character to go.
    hope this was helpful!
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    1. or you could destroy the actor if you haven't unlocked the actor's behaviors … and have the resetButton spawn the Actor at the correct X,Y
    still, I would just go with the changes in X,Y

    for any actor that you need to reference the start conditions:
    add attributes to the Actor (real-type)
    name one startX … and the other startY
    fill in with the correct value from Position X & Y
    then let the computer to the work

    Rule: on the resetButton when
    Actor receives event: touch is pressed
    --changeAttribute: [exp] (click through:) >Current scene>layers>layerActorIsOn>Actor>Position>X To: again the clicks>Actor>startX
    --changeAttribute: [exp] (click through:) >Current scene>layers>layerActorIsOn>Actor>Position>Y To: again the clicks>Actor>startY
    add if you have a dead image:
    --changeAttribute: [exp] (click through:) >Current scene>layers>layerActorIsOn>Actor>Image To: nameOfTheLiveImage

    2. for sliding a levelCompleteScreen actor, it is best to change only one of the coordinates (X or Y)
    to have yours slide up add a endY (real-type) attribute and type in that Y
    -on the original when you are sure it looks good, change its Position.Y to -300 ( for iPhone)
    add Rule to actor: when levelComplete
    --interpolate: self.Position.Y To: self.end.Y
    (do with X by making the changePosition.X To: scene.Size.Width+300 … for L sliding … and change the endY to endX, etc.)

    3. here is a great video for HUD … (Heads-Up Display)
    --to rename layers in GS: highlight the layer's name … press the enterKey and then type

    4. Resolution Independence allows devices that do not have Retina Display to still display the game gfx clearly.
    and that would devices marketed before the iPhone 4 …
    ---
    and, after you got great advice from @Braydon_SFX and some great ways to expand your skills from @lukepasqualecalarco
    I still butted in! LOL! … that is what I love about GS … many, many ways to do things and you pick what works best in a project

    MH
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    @MotherHoose - Hehe. Nice.
  • SpinningnutmegSpinningnutmeg Member Posts: 107
    edited January 2012
    How I do it is in the project below:

    http://api.cld.me/DEbl/download/simple_Reset.zip

    This way you can have lots of levels and your actor in different places for every level/scene and not have to "write down" every single position. :-)

    Zach
  • MotherHooseMotherHoose Member Posts: 2,456
    yes! and that is Great!
    @AppsOfZach

    still, when tracking many,many actors' startPosition … think that having the Actor changeAttribute: self.startX To: self.Position.X at the start of any scene the actor is more efficient …
    (my one project has 25 actors that the player can reset in one scene… and, I like to conserve my gameAttributes for things that control/track actions/events throughout the game)

    so many ways to toss this salad! ;)

    MH
  • SpinningnutmegSpinningnutmeg Member Posts: 107
    @MotherHoose Yeah. You can also have the attributes in the actor...
Sign In or Register to comment.