0 Favourites

sprite with different image & function

  • can 1 spirte have different image & function , if yes how to do it ?

    i want 1 sprite have 4 different image & 4 different function

    Thank You

  • You can use animations or simply use different animation frames from a single animation.

    You can base the function of the sprite based on the animation or animation frame that's being used.

    psuedocode:

    create object -> set animation frame to random(4)

    object.animationframe = 1

    ---- do something

    object.animationframe = 2

    ---- do something else

    etc

    ~Sol

  • hemm i want when preview like this prntscr.com/fby49i but 1 sprite with 4 image and each image have own function , still confusing

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Make a sprite, call it "button"

    Add 4 animation frames and set the animation speed to 0 (so it doesn't "play" through the frames) - and set each frame to be one of your button graphics;

    Frame 1 would be the book

    Frame 2 would be the man running

    Frame 3 would be the gear

    Frame 4 would be the window/box thing

    Then you can set the animation frame for the sprite to be whatever you want the button to look like... so if you set to frame 1, the button will be the book, or if you make it frame 3, it will be the gear.

    Then you can choose how it will behave simply by comparing which animation frame is playing.

    On Mouse.click

    --- Button.AniFrame=1(book)

    -----> Open book menu

    On Mouse.click

    --- Button.AniFrame=2(running man)

    -----> Open running menu

    etc etc

    I would make an example for you but I'm at work right now. Hopefully I explained it better this time.

    ~Sol

  • Uh sorry newly replied now, I already understand now, Thank You

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)