Main menu with animations [Resolved]

hey any idea how to do this? ok so im trying to make a main menu and theres a start button. i want it so that when the cursor hovers on the start button, it lights up and stays lit till the cursor goes off of it. right now I have the start button with square sprites to use as colliders around the start button. I also have this square sprite that follows the cursor that’s invisible. I’ve already figured out how to make the start button light up but I don’t know how to make it turn off when the cursor goes off of it. Im trying to make it so that whenever the cursor hits the start button, it lights up and stays on the last frame. Then when it touches the colliders around the start button the animation where the light goes out starts. I’m trying to figure out how to do it right now by myself by making it so that whenever the “light up animation is playing/done” and “cursor is colliding with collider” it will “play the turn off animation” with the end gate. I dont really know what im doing… My only problem here is how to make the cursor collide with the collider around the start button to do the animation. I put the behaviours on the start button itself so that I could start the animation (unless there’s another way)(can’t seem to find a way to make it so the collide can do “cursor collides with collider”

3 Likes

Flowlab Game Creator - Illuminated Friends here’s my game by the way. my game is still in progress pls no bully thanks

2 Likes

Alllllllllllllllllllrrrriiiiiiiiiiiiiighhhhhhhhhhhhhttttttttttttt
All this crap? Totally unneeded. Delete literally all your code in the start button. Drag in a MouseClick behavior. See that thing that says Over. Yeah, that is a trigger. It means when your mouse hovers over the sprite, it’s gonna activate. For the glowing thing, literally just drag in your animation, then attach the start to the Over. Set the animation on loop. There’s also a connection that says Out on the MouseClick. Connect the out to the stop of the animation. I’ll take a deeper look into the code to see what I can do.

2 Likes

Ohhh hahah yeah im not really good at this lmao. thanks for the help!

3 Likes

Took a little bit of tinkering, but here you go:

The actual code if you're confused. Copy it, and then press import when you click anywhere to paste it in the game.

{“data”:{“behavior”:{“v”:“2”,“nodes”:[{“inputCount”:3,“outputCount”:2,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:90,“y”:128,“group”:"",“id”:“e6bfbeb5a76b754d”,“animationName”:“Cursor Hover”,“priority”:0,“lastFrameSticky”:true},{“inputCount”:3,“outputCount”:2,“name”:“Animation”,“behaviorType”:“logic.properties.Animation”,“x”:90,“y”:224,“group”:"",“id”:“e7f6cbd9e4e8344d”,“animationName”:“Lights Off”,“priority”:0,“lastFrameSticky”:true},{“inputCount”:0,“outputCount”:4,“name”:“MouseClick”,“behaviorType”:“logic.triggers.MouseClick”,“x”:-270,“y”:128,“group”:"",“id”:“e99fac1db167df43”,“global”:false},{“inputCount”:3,“outputCount”:1,“name”:“Switch”,“behaviorType”:“logic.logic.Switch”,“x”:-90,“y”:160,“group”:"",“id”:“e9a0e652e7da584c”,"_startVal":1,“dataType”:2},{“inputCount”:3,“outputCount”:1,“name”:“Switch”,“behaviorType”:“logic.logic.Switch”,“x”:-90,“y”:256,“group”:"",“id”:“e9a237e8fb34a94f”,"_startVal":1,“dataType”:2},{“inputCount”:3,“outputCount”:1,“name”:“Switch”,“behaviorType”:“logic.logic.Switch”,“x”:270,“y”:256,“group”:"",“id”:“e9a2a33a5f3f754c”,"_startVal":0,“dataType”:2},{“inputCount”:2,“outputCount”:2,“name”:“LoadLevel”,“behaviorType”:“logic.gameflow.NextLevel”,“x”:450,“y”:256,“group”:"",“id”:“e9a2c5e677a5e24e”,“levelName”:“Next Level”}],“links”:[{“input_id”:“e6bfbeb5a76b754di0”,“output_id”:“e9a0e652e7da584co0”},{“input_id”:“e6bfbeb5a76b754di1”,“output_id”:“e9a237e8fb34a94fo0”},{“input_id”:“e7f6cbd9e4e8344di0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e7f6cbd9e4e8344di0”,“output_id”:“e9a237e8fb34a94fo0”},{“input_id”:“e7f6cbd9e4e8344di1”,“output_id”:“e9a0e652e7da584co0”},{“input_id”:“e9a2a33a5f3f754ci2”,“output_id”:“e7f6cbd9e4e8344do1”},{“input_id”:“e9a0e652e7da584ci0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e7f6cbd9e4e8344di0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a237e8fb34a94fi0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a2a33a5f3f754ci1”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a0e652e7da584ci2”,“output_id”:“e99fac1db167df43o2”},{“input_id”:“e9a237e8fb34a94fi2”,“output_id”:“e99fac1db167df43o3”},{“input_id”:“e9a0e652e7da584ci0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a0e652e7da584ci2”,“output_id”:“e99fac1db167df43o2”},{“input_id”:“e7f6cbd9e4e8344di1”,“output_id”:“e9a0e652e7da584co0”},{“input_id”:“e9a237e8fb34a94fi0”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a237e8fb34a94fi2”,“output_id”:“e99fac1db167df43o3”},{“input_id”:“e7f6cbd9e4e8344di0”,“output_id”:“e9a237e8fb34a94fo0”},{“input_id”:“e9a2a33a5f3f754ci1”,“output_id”:“e99fac1db167df43o0”},{“input_id”:“e9a2a33a5f3f754ci2”,“output_id”:“e7f6cbd9e4e8344do1”},{“input_id”:“e9a2c5e677a5e24ei0”,“output_id”:“e9a2a33a5f3f754co0”},{“input_id”:“e9a2c5e677a5e24ei0”,“output_id”:“e9a2a33a5f3f754co0”}]}}}

1 Like

Also, please delete the colliding blocks that you don’t need anymore. It’ll make your game run smoother. Not by a whole lot, but smoother.

1 Like

tysm!! I had no idea what I was doing at all…

2 Likes

strange… for some reason when I copy paste the behaviour, it doesn’t paste anything…

2 Likes

You have to click “import” first.
Screenshot 2021-09-15 9.53.12 AM
Screenshot 2021-09-15 9.53.23 AM

2 Likes

yes I knew that… I just had to reload the website for some reason hehe

2 Likes

the code didn’t work out as I wanted it but after a tiny bit of messing around with it I managed to make it work :smiley: thanks for everyone who helped!

2 Likes

Well I hope you got your desired results, thank you @hihilogic for helping them out :grinning_face_with_smiling_eyes:

1 Like

As always…
ya welcome :sunglasses:

1 Like

Also, you might wanna delete this line. It’s not needed, and creates an infinite loop, constantly causing it to collide with “win”
image