Change Images in other scenes

RobinRufRobinRuf Member, PRO Posts: 9

Hey there,
This is my first post here - I hope I posted it correctly.

My question is easy but I don't know how I can do this!

I want to change my image in another scene as where I changed it.
Ok, I think I must explain it a little bit more!

I had made a Item Store. In this, Players can buy avatars and equip it.
My only problem now is: I don't know how I can do it that the Image of the Player changes when I press the "equip"-Button on the store.

For now I do this:
Actor1 = Main Actor (Player) // (is in the game-scene)
Actor2 = Avatar (You can buy in the store)
Equip-Button = To equip the bought avatar as "Actor1" (Player) // (is in the store-scene)

And now I want to make this:
If you press the "Equip-Button" then the Image of "Actor1" will change to the Image of "Actor2" and still leave changes until you equip another Avatar from the store.

I hope you guys understand what I want to do!

Can someone help me ? :smile:

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,701

    Your questions seems a bit confusing to me but here is what I think would work.

    Create a global attribute called Equip (or whatever you like)

    When the player chooses an avatar from the store change the value of Equip to match which avatar was picked (1, 2, 3, etc)

    When you load the scene with the player check the value of Equip and use it to place the correct player on screen.

  • RobinRufRobinRuf Member, PRO Posts: 9
    edited April 2017

    Thank you!
    I got it ! :smiley:

    I have another question now :wink:

    In my store it shows the "Buy"- and the "Equip"-Button for each Avatar that can be bought!
    Now I want to make it, that the "Equip"-Button is disabled untill you bought the avatar.
    When you bought it then I want to disable the "Buy"-Button and enabled permanently the "Equip"-Button.

    How I can do this ? :hushed:

  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,701
    edited April 2017

    I've attached a quick demo for you to check out. Pick and image on the first scene and it will display correctly on the second. If you don't pick and image you'll just get a blank white square. Let me know if you have any questions.

    There are other ways of doing this. This method is probably the quickest if you only want to change an actors image and not their rules and behaviors.

  • RobinRufRobinRuf Member, PRO Posts: 9

    Thanks for this quick reply.
    But I got it now :wink:

    Now my Question changes :wink:

    In my store it shows the "Buy"- and the "Equip"-Button for each Avatar that can be bought!
    Now I want to make it, that the "Equip"-Button is disabled untill you bought the avatar.
    When you bought it then I want to disable the "Buy"-Button and enabled permanently the "Equip"-Button.

    How I can do this ? :hushed:

  • pHghostpHghost London, UKMember Posts: 2,302

    Best to use a table for this. There you can save the data if a certain avatar was bought or not.

    You can find tutorials on using tables in GameSalad in YouTube.

  • RobinRufRobinRuf Member, PRO Posts: 9

    Thank you dude - everything is worked perfectly now!
    Now I have one last question. (I ask here instead make a new discussion)

    How I can make the physics from an actor (Avatar) like Flappy Bird ?

  • pHghostpHghost London, UKMember Posts: 2,302

    Add gravity to the avatar (Accelerate). That will make it go down if nothing is happening.

    Then make a button. When you press the button, change the avatar's Y Velocity to +XXXX -- you will need to play with the strength of gravity and Y Velocity number to get the exact feeling you want.

  • RobinRufRobinRuf Member, PRO Posts: 9

    I want the exact physics from Flappy. Not only "up" and "down"
    (Hope you know what I mean.)

    Is this, what you explain, for the exact physics ?

  • pHghostpHghost London, UKMember Posts: 2,302

    Yep, that's the exactly it. In Flappy Bird that's the physics. That's what I use in my game: https://itunes.apple.com/us/app/sinky-submarine-free/id906914127?mt=8

    Then you have the obstacles spawning on a timer and moving at you. If you want it to be endless.

    If you want to have a set length level with level design, then you also add a X Velocity to the avatar.

  • SocksSocks London, UK.Member Posts: 12,822

    @pHghost said:
    Add gravity to the avatar (Accelerate). That will make it go down if nothing is happening.

    Make sure the Direction is relative to Scene.

  • RobinRufRobinRuf Member, PRO Posts: 9
    edited April 2017

    Thank you very much guys :smile:
    But I have a problem.
    It works now, but not how I want!
    The Avatar now go up/down like a board and not like Flappy Original.
    I have do this: if Touch is outside then move self.position.Y+30
    Did I forgot something ?
    Screen: https://ibb.co/jejk85

    And have one more question :smiley:
    Is there any option how I can save sounds from a Templete (GS) to my Computer ?
    I want to use some sounds of another game for my game and need to save the sounds to my desktop for this.

    If no - where I can find the sounds of Flappy (for free) ? :wink:

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2017

    @RobinRuf said:
    Thank you very much guys :smile:
    But I have a problem.
    It works now, but not how I want!
    The Avatar now go up/down like a board and not like Flappy Original.
    I have do this: if Touch is outside then move self.position.Y+30
    Did I forgot something ?
    Screen: https://ibb.co/jejk85

    When mouse button is down
    --Change Linear velocity Y to 400

    . . . . .

    + Accelerate downwards for gravity as described above.

    @RobinRuf said
    And have one more question :smiley:
    Is there any option how I can save sounds from a Templete (GS) to my Computer ?
    I want to use some sounds of another game for my game and need to save the sounds to my desktop for this.

    Right click (OSX) on the GameSalad file > Show package contents > Sounds

  • pHghostpHghost London, UKMember Posts: 2,302
    edited April 2017

    @RobinRuf said:
    Did I forgot something ?

    In the screenshot, you are using Move To. That is not the correct behaviour. Either use Change Attribute to change Linear Velocity Y or use Accelerate in the opposite direction of gravity.

    @RobinRuf said:
    I want to use some sounds of another game for my game and need to save the sounds to my desktop for this.

    If no - where I can find the sounds of Flappy (for free) ? :wink:

    OK, listen. If it's a freely available template, you can probably use the sounds. But otherwise, it is not OK to use sounds and graphics from other people's games. There are plenty websites where you can download legal public domain or similarly licensed assets. Again, do not steal other people's work.

    Make something original. Even if you are using similar game mechanics as a game already out there, to learn and hone your skills, at least make visually distinct.

  • RobinRufRobinRuf Member, PRO Posts: 9

    Ok i think i am to confused or to stupid for this :wink:

    And the sounds are in a free template of a Flappy Clone and its the original sounds from Flappy.

  • pHghostpHghost London, UKMember Posts: 2,302
    edited April 2017

    @RobinRuf said:
    the sounds are in a free template of a Flappy Clone and its the original sounds from Flappy

    Then that person stole the sounds in the first place. If you know it's the original sounds, as you say, and you don't have permission to use them from the original author, well, it seems too clear to not understand. Just because someone else stole them before you doesn't make it's OK for you to do the same.

  • RobinRufRobinRuf Member, PRO Posts: 9

    No, I don't use the original Sounds. But it would not have been so bad if I had used the sounds 'cause I don't wanna publish my Flappy Clone! (There are more than enough Flappy Clones on the market! Nobody needs another one :wink:

    This "Project" was only to practice!

    By the way, I finally got it (Flight Physics) <-- Thanks to @Socks & @pHghost

Sign In or Register to comment.