Help needed with Change Image and Actor position?

GuaveMediaGuaveMedia Member, PRO Posts: 1,262
edited February 2012 in Working with GS (Mac)
Hey,
I really need some help with my new project. I have a scene 320x960, the game only plays till y 480 as normal, then I have two actors for the ground which move downwards, scene y is wrapped.But I want to change the ground actor at a certain time. I would like to do this with change image.
But it should change at Y 480-960 so that the player does not see the change. I tried it with a slef position condition but it did not work, thanks for any help :)

Alex

Comments

  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Nobody an idea? :/

    mhmm....
  • SAZ_1SAZ_1 Member Posts: 397
    what did you try?... when self pos is >= 480 and <= 960 change image?? whats not working the image change or the fact you see the image change
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Yeah exactly. I just want it to change on the upper half of the scene so the player does not notice it...
  • MotherHooseMotherHoose Member Posts: 2,456
    the problem is in the Wrap behavior
    a wrapY will cause the Y to move down till the Y = 0 - self.Size.Height
    the actual Y changes to the max scene height at Y = 0 - self.Size.Height/2
    this is why the image will seem to be split in half at the sceneY 0 and sceneY 960

    you can put a textDisplay on the actor to display self.Position.Y and see that once Y = 0 it will display the Y as 950 to 960 range
    (to see this, you have to use the sceneEditor's Preview and not the one on the toolBar)

    to correct your problem:
    Rule: when (All)
    Attribute: self.Position.Y < 650
    Attribute: self.Position.Y > 550
    --changeAttribute: self.Image To: nameNewImage

    don't use ≤ or ≥ as those conditions will be valid when your image is still visible in the bottom of the scene

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Thank you MotherHoose :)

    but it doesn't work correctly, the actor has a height of 480, and I want to change the image so that the player can't see it,
    otherwise it looks very unprofessional...
    Now it changes in the scene, mhmmm....

    Thx Alex
  • MotherHooseMotherHoose Member Posts: 2,456
    edited February 2012
    okay you are working with a background actor that is sceneDisplay size

    WrapY is not going to work … as before: the Y actually changes To: 960 at 0 when that is √ed
    so uncheck it!

    on your backgroundActor:
    Rule: when
    Arttribute:  self.Position.Y ≤ -240
    --ChangeImage
    --changeAttribute: self.Position.Y To: 720

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Okey I unchecked wrap scene Y.

    Okay just one problem again :/

    I have two actors for the ground. Each actor is 480 at height, and moves down.
    I used your rule but it still doesn't work...

    Driving me crazy...

    Alex
  • MotherHooseMotherHoose Member Posts: 2,456
    put a displayText behavior on those two actors: exp: self.Position.Y
    do your preview in the sceneEditor … see if changes are happening and when

    the rules have to be on each bgActor
    as behaviors are processed in linear order … the changeImage has to be before the change Y

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Ok just forgot the chnage image for a second. It is only about the "moving ground"..

    Thx
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    What happens now is that the actor gets set back to 720 when it's position <= 240, as you told me.
    But then it comes again from above and underneath is nothing left ...

    Hope you know what I mean...
  • MotherHooseMotherHoose Member Posts: 2,456
    edited February 2012
    sorry:    Y ≤-240 … that is: less than or equal to minus 240

    hard to visualize, but values for X and Y can be:   + or - just about any number

    @};-
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    I don't know what you mean right now.

    I know what Y ≤-240 means, but it still does not work in the scene... mhmmm

    Alex
  • MotherHooseMotherHoose Member Posts: 2,456
    did you preview in the sceneEditor Preview ???
    not the Preview in the toolBar …
    to see what is happening and when

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Looks like the actor above does not move?
    At the upper half..

    And I don't know why ....
  • MotherHooseMotherHoose Member Posts: 2,456
    okay … now … √ the rules/behaviors/motionAttributes on the topBG

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Okey,

    same as in the actor on the bottom.

    Move direction 270 and
    Attribute: self.Position.Y ≤ -240
    changeAttribute: self.Position.Y To: 720
  • MotherHooseMotherHoose Member Posts: 2,456
    does the top have the change image behavior?
    this works for me … and I can't figure it out for you, Alex!

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    No I just wanted it to work without change image at the moment,
    just the two actors moving like a ground..

    thx
  • MotherHooseMotherHoose Member Posts: 2,456
    and the change Y is in a Rule?

    sent a PM to your Profile …

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Sent you a PM back !

    thx
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    AHHH...
    @MotherHoose: What to do when a little gap appears after some time between
    the actors?

    thx
  • MotherHooseMotherHoose Member Posts: 2,456
    in this situation where the images probably have adjoining pixels with the same color
    you could just change the sceneAttribute: Color to that color

    otherwise add 1 transparent pixel to the top or bottom row in your graphics program

    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    What exactly do you mean with the first option?

    thx
  • MotherHooseMotherHoose Member Posts: 2,456
    Inspector: Game | Scene
    Scene Attributes
    Color: change it from the default black
    ===
    Alex, you have to start doing the cookbook and videos and playing around with all the buttons in GS till you learn what they do and what you can do with them!

    It's an adventure! that can be enjoyable and worthwhile!
    @};- MH
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Hey,
    that's not the problem. I tried what you ment but the gap is getting bigger and bigger when the game
    lasts for a while...
    And something really annoying is also that the ground movement at all looks not fluid, it is a bit stacked..
    Mhmmm...

    Thx MotherHoose
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    I sent you an email MotherHoose,

    please check it out.. :)

    Alex
Sign In or Register to comment.