How do I create the same sprite + current frame? (duplicate)

0 favourites
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • BTW - Do you think there is a way to make the rotate part (with the wheel) if there are few shapes over each other, so it will ONLY rotate the one that is clicked last?

    Not sure how to explain it because of my bad English but I wonder about it, right now it's rotating all the shapes under the mouse.

  • Add an instance variable to the selection sprite (Sprite2), and store the UID of the main Sprite on Click. Then add Sprite2.CurrentUID = Sprite.UID to the wheel up, and then wheel down event. This will limit it in the way you want.

    I've done it here, but give it a try yourself.

  • Unfortunately, I have no idea how to work with UID yet, so it was hard for me to follow your instructions.

    So, I took a look on the manual but it didn't help me to understand exactly what I'm doing.

    I did create an instance variable called: 'Selection' by clicking on the Sprite2 (the animated selection sprite) on the layout. but from that point you'll see what a mess I did because I need to understand it better, the manual didn't help me much because I better see see this in action to understand the logic behind it of store and restore variables and such.

    Lets say I don't have Sprite2 at all, (I just made it for fun anyway), is it still possible to do? or it will be easier with this extra sprite?

    Can please you try to instruct me more specific, step-by-step. I hope that I'll get more confidence in C2 by the day, I'm already messing with it a few days now and discover and learning new things every day!

    Here is a screenshot of what I did (marked the lines).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Select the SpriteSelection in the Layout to see that it has a new instance variable: SelectedUID. In event 2, add SelectedUID = SpriteUID. In 7 and 8 test for SelectedUID = Sprinte.UID. In 12, reset the SelectedUID, when you deselect.

    You can do the same with a Global variable and without the selection, but then it isn't obvious which one is selected, and which needs the cursor over it to do the rotation. Your call.

  • I just had to look on your file, and read your instructions to follow. but it's not working (your file).

    I can still rotate everything under the shape I clicked.

  • Ah. We need to clarify. I kept dragging them apart and made it so only the selected one would rotate. If you have three on top of each other, then it's trickier to know which one to pick. Are these expected to be stacked? It's going to be hard to pick and edit if so.

  • Yes! this is exactly what I was trying to do.

    I'm trying to understand the picking / UID and instance/global variables via the manual but believe it or not... the best way I've understood things in C2 were via Video Tutorials, maybe my brain gets it better that way because it actually shows me an example done a step by step.

    I'm trying to look for more video tutorials on these subject because I understand it's very important to understand how to use them and when, especially in more complicated situations... I must understood how it works in order to use them, that's for sure.

    Thank you once again for being so kind and patience with me, I appreciate it a lot.

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