I would like to add a few puzzles to my game sort of like there is a box with four numbers that change when you click on an arrow above the number.
these are a couple of pictures to show what I mean.
The Number Sprites
and the main puzzle box sprite
What is the easiest way to achieve this
Thanks.
insein
2
Hey, the easiest solution I can think of:
1st declare a number variable to the Box object. I’ll call it Num.
Conditions:
- Cursor is on Arrow
- Mouse Left button released
- Pick nearest Box to: Arrow.X() ; Arrow.Y()
Actions:
- Change variable Num of Box: add 1
- Change the number of animation of Box to Box.Num
Sub-event:
- Num of Box > 9 → Change the number of animation of Box = 0 / Change variable Num of Box to 0
1 Like
MrMen
3
The problem with that solution is 9 won’t be displayed - if the num is 9, it is changed to 0. It should be num of box = 10.
However, there’s a simpler method; using the same conditions as in @insein’s solution, just have this one action (no need for the subevent either):
2 Likes
insein
4
Thanks for pointing out the mistake, I meant > 9. The mod is a great solution tho!
2 Likes