JR 01's Weekly Coding Challenge

Answer

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-360,"y":208,"group":"0876df518b2eeb44","id":"087e1f6a2197634f","resetOnLevelStart":false},{"inputCount":6,"outputCount":2,"name":"Ease","behaviorType":"logic.logic.Ease2","x":-180,"y":208,"group":"0876df518b2eeb44","id":"087e1f6b3717f84e","duration":0.8,"from":100,"to":2,"easeFunc":"Quadratic","easeType":2,"smartRot":false},{"inputCount":3,"outputCount":3,"name":"Size","behaviorType":"logic.properties.Scale","x":0,"y":208,"group":"0876df518b2eeb44","id":"087e1f6b62eee74d"},{"inputCount":2,"outputCount":2,"name":"Toggle","behaviorType":"logic.logic.FlipFlop","x":0,"y":320,"group":"0876df518b2eeb44","id":"087e1f6b26a68248","loop":true,"initialState":0}],"links":[{"input_id":"087e1f6b3717f84ei3","output_id":"087e1f6a2197634fo0"},{"input_id":"087e1f6b3717f84ei3","output_id":"087e1f6a2197634fo0"},{"input_id":"087e1f6b3717f84ei3","output_id":"087e1f6b26a68248o0"},{"input_id":"087e1f6b3717f84ei4","output_id":"087e1f6b26a68248o1"},{"input_id":"087e1f6b62eee74di1","output_id":"087e1f6b3717f84eo0"},{"input_id":"087e1f6b26a68248i0","output_id":"087e1f6b3717f84eo1"},{"input_id":"087e1f6b26a68248i1","output_id":"087e1f6b3717f84eo1"},{"input_id":"087e1f6b62eee74di1","output_id":"087e1f6b3717f84eo0"},{"input_id":"087e1f6b26a68248i0","output_id":"087e1f6b3717f84eo1"},{"input_id":"087e1f6b26a68248i1","output_id":"087e1f6b3717f84eo1"},{"input_id":"087e1f6b3717f84ei3","output_id":"087e1f6b26a68248o0"},{"input_id":"087e1f6b3717f84ei4","output_id":"087e1f6b26a68248o1"}]}}}

I prefer seeing a portion of the sprite still, which is why I keep it at 2 as the minimum size. Also just avoids any issues that Flowlab occasionally have with sprites at 0 size. Other ease settings are fine, I just prefer this one because it feels like it shows the front slightly longer than Linear or something else would.

Though this isn’t perfect, it still just looks more like squashing then stretching the sprite. So I’d swap the sprite once it’s finished to sell the effect more, or make the sprite slightly darker as it gets smaller. Didn’t add it though as it’s not a required part of the challenge.

1 Like

m yeah I forgot about leaving some portion of the sprite lol

it neets thickness

1 Like

I made this a while ago…

Code Here

image

It is just easier to list the code, instead of four screenshots.

`"

data":{"behavior":{"v":"2","nodes":[{"inputCount":4,"outputCount":0,"name":"Flip+","behaviorType":"logic.NodeGroup","x":450,"y":48,"id":"76633c63292d4948","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":-32,"group":"76633c63292d4948","id":"76633c655a822843","portId":"76633c63292d4948i0","tag":"Toggle","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":48,"group":"76633c63292d4948","id":"76633c6562bd8a4c","portId":"76633c63292d4948i1","tag":"Flip","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":128,"group":"76633c63292d4948","id":"76633c66e712cb45","portId":"76633c63292d4948i2","tag":"Back","dataType":2},{"inputCount":6,"outputCount":2,"name":"Ease","behaviorType":"logic.logic.Ease2","x":180,"y":32,"group":"76633c6c1fddf942","id":"76633c6752119a42","duration":0.1,"from":100,"to":0,"easeFunc":"Quadratic","easeType":0,"smartRot":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":0,"y":128,"group":"76633c6c1fddf942","id":"76633c68a59cc846","portId":"76633c6c1fddf942i0","tag":"Flip","dataType":2},{"inputCount":6,"outputCount":2,"name":"Ease","behaviorType":"logic.logic.Ease2","x":360,"y":32,"group":"76633c6c1fddf942","id":"76633c680196d544","duration":0.1,"from":0,"to":100,"easeFunc":"Quadratic","easeType":0,"smartRot":false},{"inputCount":3,"outputCount":3,"name":"Size","behaviorType":"logic.properties.Scale","x":450,"y":-112,"group":"76633c6c1fddf942","id":"76633c6a445b5243"},{"inputCount":3,"outputCount":3,"name":"Flip","behaviorType":"logic.properties.Flip","x":630,"y":176,"group":"76633c6c1fddf942","id":"76633c6a623f9346","spriteOnly":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":0,"y":208,"group":"76633c6c1fddf942","id":"76633c6b74c9fa4f","portId":"76633c6c1fddf942i1","tag":"Back","dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":160,"group":"76633c6c1fddf942","id":"76633c6b61ea0547","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":256,"group":"76633c6c1fddf942","id":"76633c6bc9f2084b","_startVal":0,"dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":0,"y":-48,"group":"76633c6c1fddf942","id":"76633c6b76a9b24f","portId":"76633c6c1fddf942i2","tag":"Time","dataType":2},{"inputCount":3,"outputCount":0,"name":"Flip Ease","behaviorType":"logic.NodeGroup","x":270,"y":32,"group":"76633c63292d4948","id":"76633c6c1fddf942","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":-32,"group":"76633c6eca14c943","id":"76633c6c539c9847","portId":"76633c6eca14c943i0","tag":"In1","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":112,"group":"76633c6eca14c943","id":"76633c6c349b5241","portId":"76633c6eca14c943i1","tag":"In2","dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":180,"y":-48,"group":"76633c6eca14c943","id":"76633c6c8d180e4a","_startVal":1,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":180,"y":96,"group":"76633c6eca14c943","id":"76633c6cdbe7ab4b","_startVal":0,"dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":450,"y":-48,"group":"76633c6eca14c943","id":"76633c6d04cf624f","portId":"76633c6eca14c943o0","tag":"Out1","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":450,"y":112,"group":"76633c6eca14c943","id":"76633c6d81b65645","portId":"76633c6eca14c943o1","tag":"Out2","dataType":2},{"inputCount":2,"outputCount":2,"name":"Close Gate","behaviorType":"logic.NodeGroup","x":90,"y":80,"group":"76633c63292d4948","id":"76633c6eca14c943","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":90,"y":176,"group":"76633c63292d4948","id":"76633c6eb645084a","portId":"76633c63292d4948i3","tag":"Time","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":-32,"group":"76633c6f611cbf45","id":"76633c6e8dda6b47","portId":"76633c6f611cbf45i0","tag":"In","dataType":2},{"inputCount":2,"outputCount":2,"name":"Toggle","behaviorType":"logic.logic.FlipFlop","x":90,"y":-32,"group":"76633c6f611cbf45","id":"76633c6fe1657545","notes":"I have no idea why I did this. :)","n_o":1,"loop":true,"initialState":0},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":270,"y":-48,"group":"76633c6f611cbf45","id":"76633c6f8e5d9d42","portId":"76633c6f611cbf45o0","tag":"Flip","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":270,"y":32,"group":"76633c6f611cbf45","id":"76633c6fa457214e","portId":"76633c6f611cbf45o1","tag":"Back","dataType":2},{"inputCount":1,"outputCount":2,"name":"Toggle Gate","behaviorType":"logic.NodeGroup","x":90,"y":0,"group":"76633c63292d4948","id":"76633c6f611cbf45","isMenuItem":false}],"links":[{"input_id":"76633c6f611cbf45i0","output_id":"76633c655a822843o0"},{"input_id":"76633c6eca14c943i0","output_id":"76633c6562bd8a4co0"},{"input_id":"76633c6eca14c943i1","output_id":"76633c66e712cb45o0"},{"input_id":"76633c6a445b5243i1","output_id":"76633c6752119a42o0"},{"input_id":"76633c680196d544i3","output_id":"76633c6752119a42o1"},{"input_id":"76633c6b61ea0547i2","output_id":"76633c6752119a42o1"},{"input_id":"76633c6bc9f2084bi2","output_id":"76633c6752119a42o1"},{"input_id":"76633c6752119a42i3","output_id":"76633c68a59cc846o0"},{"input_id":"76633c6b61ea0547i1","output_id":"76633c68a59cc846o0"},{"input_id":"76633c6bc9f2084bi0","output_id":"76633c68a59cc846o0"},{"input_id":"76633c6a445b5243i1","output_id":"76633c680196d544o0"},{"input_id":"76633c6752119a42i3","output_id":"76633c6b74c9fa4fo0"},{"input_id":"76633c6b61ea0547i0","output_id":"76633c6b74c9fa4fo0"},{"input_id":"76633c6bc9f2084bi1","output_id":"76633c6b74c9fa4fo0"},{"input_id":"76633c6b61ea0547i0","output_id":"76633c6b61ea0547o0"},{"input_id":"76633c6a623f9346i0","output_id":"76633c6b61ea0547o0"},{"input_id":"76633c6a623f9346i1","output_id":"76633c6bc9f2084bo0"},{"input_id":"76633c6bc9f2084bi0","output_id":"76633c6bc9f2084bo0"},{"input_id":"76633c6752119a42i0","output_id":"76633c6b76a9b24fo0"},{"input_id":"76633c680196d544i0","output_id":"76633c6b76a9b24fo0"},{"input_id":"76633c6c8d180e4ai2","output_id":"76633c6c539c9847o0"},{"input_id":"76633c6cdbe7ab4bi1","output_id":"76633c6c539c9847o0"},{"input_id":"76633c6c8d180e4ai1","output_id":"76633c6c349b5241o0"},{"input_id":"76633c6cdbe7ab4bi2","output_id":"76633c6c349b5241o0"},{"input_id":"76633c6c8d180e4ai0","output_id":"76633c6c8d180e4ao0"},{"input_id":"76633c6d04cf624fi0","output_id":"76633c6c8d180e4ao0"},{"input_id":"76633c6cdbe7ab4bi0","output_id":"76633c6cdbe7ab4bo0"},{"input_id":"76633c6d81b65645i0","output_id":"76633c6cdbe7ab4bo0"},{"input_id":"76633c6c1fddf942i0","output_id":"76633c6eca14c943o0"},{"input_id":"76633c6c1fddf942i1","output_id":"76633c6eca14c943o1"},{"input_id":"76633c6c1fddf942i2","output_id":"76633c6eb645084ao0"},{"input_id":"76633c6fe1657545i0","output_id":"76633c6e8dda6b47o0"},{"input_id":"76633c6fe1657545i1","output_id":"76633c6e8dda6b47o0"},{"input_id":"76633c6f8e5d9d42i0","output_id":"76633c6fe1657545o0"},{"input_id":"76633c6fa457214ei0","output_id":"76633c6fe1657545o1"},{"input_id":"76633c6c1fddf942i0","output_id":"76633c6f611cbf45o0"},{"input_id":"76633c6c1fddf942i1","output_id":"76633c6f611cbf45o1"}]}}}
[/

Spawning Rain with random.

April 24th, 2024
Difficulty: Intermediate
(Calendar & Rules)

Share a screenshot of how you would spawn rain from the top of the level. It should be randomly spawned from the top of the level and disapear when it hits the ground.

image

2 Likes

It’s been a busy week for me, here’s the answer for Monday.
I’ll post the answer for Wednesday later today and start Today’s challenge.

Monday's Answer

image

2 Likes

Spawning Rain

Answer

image

1 Like

Counting with Proximity

April 26th, 2024
Difficulty: Challenging
(Calendar & Rules)

Share a screenshot of how to count the number of objects selected with proximity. This can be coins, enemies, or items. Make a version of code that uses once to count the objects, and then another version with always that shows a live count in the proximity.

image

2 Likes
Answer

3 Likes

Also I’m cheating a bit because I’ve viewed all of JR’s examples in the past lol, wealth of knowledge there

Answer

Always

If it’s just visual display, no need to get the Number Afterward as you’ll only see the final result and it’s just a minor amount worse on performance (though actually probably better because you can use a Number instead of an expression), but for something that needs to count the enemies to perform a certain action you’d want only the total value, not all the values leading up to the total.

Once

4 Likes

These are correct, you can use a proximity to count the number of objects inside the proximity.

Answer

Back in the day, this is also how I counted how many coins were in each level of Escape the Rewind. The proximity works alot better nowadays, but a huge proximity set to an item used for just the first frame didn’t effect performance all that bad. You just have to be carefule on how you decide to use them.

image

2 Likes

I’ve been meaning to do one of these for a while but been pretty busy irl, but here’s the first Expert challenge. Also we may change the calender a bit since not many participates in the beginner challenges.

Spawn a wave of spikes

April 29th, 2024
Difficulty: Expert
(Calendar & Rules)

Use an expression and spawn behaviors to spawn a wave of spikes in a strait line towards the player from an enemy. This is perspective to a topdown game. Share a screenshot of the code and the math used in the expression on how to do this. Be sure the read the rules above.

You should use extractors, globals, expressions, spawns and timers.

image

3 Likes

not quite sure if this is what you’re talking about…

Answer

Flowlab Game Creator - New Game




I’m just using math that outputs x,y based off of a beginning point, rotation, and distance.

3 Likes

I decided not to the challenge because I was too lazy/just didn’t wanna do it.

Yours looks super cool though! Do you think I could save the code for later projects of mine or just to research it so I could learn from it?

1 Like

yeah that’s fine

1 Like
Answers

There’s some room for interpretation within the question, so I’ll give two possible solutions for it.


This will send out the objects towards the objects. An extra bit of code should be added to determine how many you’d like to spawn depending on the distance to the player. (Eases are set to Linear)
Also, technically the “Numbers” aren’t needed, just assumed I would be expanding the system more.

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-180,"y":-64,"group":"2c65bc40ccecfb45","id":"2c668d5c9713bf43","tag":"Object 2 X:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-180,"y":144,"group":"2c65bc40ccecfb45","id":"2c668dd7dc6abe4e","tag":"Object 2 Y:Number","version":2,"dataType":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":0,"y":-160,"group":"2c65bc40ccecfb45","id":"2c66c879c04dec4b","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":0,"y":48,"group":"2c65bc40ccecfb45","id":"2c66c8e50b9fd040","targetId":0,"prop":"y","version":2},{"inputCount":6,"outputCount":2,"name":"Ease","behaviorType":"logic.logic.Ease2","x":180,"y":-160,"group":"2c65bc40ccecfb45","id":"2c6ba58158897247","duration":3,"from":0,"to":100,"easeFunc":"Linear","easeType":0,"smartRot":false},{"inputCount":6,"outputCount":2,"name":"Ease","behaviorType":"logic.logic.Ease2","x":180,"y":48,"group":"2c65bc40ccecfb45","id":"2c6ba5efd838334a","duration":3,"from":0,"to":100,"easeFunc":"Linear","easeType":0,"smartRot":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":144,"group":"2c65bc40ccecfb45","id":"2c6bb9ebfef8bc47","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":-64,"group":"2c65bc40ccecfb45","id":"2c6bba61695c7d40","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Spawn","behaviorType":"logic.components.Spawn2","x":450,"y":48,"group":"2c65bc40ccecfb45","id":"2c6cd3dfcc07f14a","entityClassId":15364132,"spawnX":0,"spawnY":0},{"delay":5,"count":6,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":180,"y":176,"group":"2c65bc40ccecfb45","id":"2c6ce9d86f698142"},{"inputCount":0,"outputCount":2,"name":"Keyboard","behaviorType":"logic.triggers.Keyboard","x":-180,"y":48,"group":"2c65bc40ccecfb45","id":"2c6737f6e205414e","keyCode":32}],"links":[{"input_id":"2c6bba61695c7d40i0","output_id":"2c668d5c9713bf43o0"},{"input_id":"2c6bb9ebfef8bc47i0","output_id":"2c668dd7dc6abe4eo0"},{"input_id":"2c66c879c04dec4bi0","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6ba58158897247i1","output_id":"2c66c879c04dec4bo0"},{"input_id":"2c66c8e50b9fd040i0","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6ba5efd838334ai1","output_id":"2c66c8e50b9fd040o0"},{"input_id":"2c6ba58158897247i1","output_id":"2c66c879c04dec4bo0"},{"input_id":"2c6ba58158897247i2","output_id":"2c6bba61695c7d40o0"},{"input_id":"2c6ba58158897247i3","output_id":"2c6bba61695c7d40o0"},{"input_id":"2c6cd3dfcc07f14ai0","output_id":"2c6ba58158897247o0"},{"input_id":"2c6ba5efd838334ai1","output_id":"2c66c8e50b9fd040o0"},{"input_id":"2c6ba5efd838334ai2","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6ba5efd838334ai3","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6cd3dfcc07f14ai1","output_id":"2c6ba5efd838334ao0"},{"input_id":"2c6bb9ebfef8bc47i0","output_id":"2c668dd7dc6abe4eo0"},{"input_id":"2c6bb9ebfef8bc47i1","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6ba5efd838334ai2","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6ba5efd838334ai3","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6ce9d86f698142i0","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6bba61695c7d40i0","output_id":"2c668d5c9713bf43o0"},{"input_id":"2c6bba61695c7d40i1","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6ba58158897247i2","output_id":"2c6bba61695c7d40o0"},{"input_id":"2c6ba58158897247i3","output_id":"2c6bba61695c7d40o0"},{"input_id":"2c6cd3dfcc07f14ai0","output_id":"2c6ba58158897247o0"},{"input_id":"2c6cd3dfcc07f14ai1","output_id":"2c6ba5efd838334ao0"},{"input_id":"2c6cd3dfcc07f14ai2","output_id":"2c6ce9d86f698142o0"},{"input_id":"2c6ce9d86f698142i0","output_id":"2c6bb9ebfef8bc47o0"},{"input_id":"2c6cd3dfcc07f14ai2","output_id":"2c6ce9d86f698142o0"},{"input_id":"2c66c879c04dec4bi0","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6bba61695c7d40i1","output_id":"2c6737f6e205414eo0"},{"input_id":"2c66c8e50b9fd040i0","output_id":"2c6737f6e205414eo0"},{"input_id":"2c6bb9ebfef8bc47i1","output_id":"2c6737f6e205414eo0"}]}}}

Then I realized that the first solution I thought of probably wasn’t intentional. I’m assuming JR wanted some like in WITW, so it spawns along that line for a preset distance.

Just a pretty simple thing, surprised this is Expert, it’s decently easy if you know basic geometry.
Also technically (wouldn’t recommend) you can do some funky stuff to loop the expression back on itself and expand the expression, and that would remove the need for the “Distance” expression. But again, wouldn’t recommend as there is basically no benefit in this case and is just unneeded extra time to figure it out.

Expression 
C+Math.cos(A*Math.PI/180)*B

// C = Enemy X/Y
// A = Angle (Math.PI/180 converts to radians)
// B = The distance between "spikes"

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-270,"y":-80,"group":"2c65bc40ccecfb45","id":"2c75e7b817ad7543","tag":"Object 2 Y:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-270,"y":-176,"group":"2c65bc40ccecfb45","id":"2c75e8394c1d1f4c","tag":"Object 2 X:Number","version":2,"dataType":2},{"inputCount":0,"outputCount":2,"name":"Keyboard","behaviorType":"logic.triggers.Keyboard","x":-270,"y":112,"group":"2c65bc40ccecfb45","id":"2c767dc7ea224349","keyCode":32},{"expression":"C+Math.cos(A*Math.PI/180)*B","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":3,"version":2,"tag":"X Position","inputCount":4,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":270,"y":-176,"group":"2c65bc40ccecfb45","id":"2c76cb26ef72ab4f","notes":"Adjusts X position based on the angle to the player","n_o":1},{"expression":"C+Math.sin(A*Math.PI/180)*B","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":3,"version":2,"tag":"Y Position","inputCount":4,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":270,"y":16,"group":"2c65bc40ccecfb45","id":"2c76d7c1b2628f47","notes":"Adjusts X position based \non the angle to the player","n_o":1},{"expression":"A+48","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"Distance","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":90,"y":112,"group":"2c65bc40ccecfb45","id":"2c77309ebf05c649"},{"inputCount":2,"outputCount":1,"name":"PointAt","behaviorType":"logic.components.PointAt","x":90,"y":-176,"group":"2c65bc40ccecfb45","id":"2c77901db8961545","skipRot":true},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-90,"y":-176,"group":"2c65bc40ccecfb45","id":"2c77a4c821479e40","notes":"Just so the angle is not constantly updated","n_o":1,"startVal":0,"tag":"Player X","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-90,"y":-80,"group":"2c65bc40ccecfb45","id":"2c77a68d5263434a","startVal":0,"tag":"Player Y","roundMode":1},{"delay":1,"count":10,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-90,"y":112,"group":"2c65bc40ccecfb45","id":"2c78a73aa9fc1346"},{"inputCount":3,"outputCount":1,"name":"Spawn","behaviorType":"logic.components.Spawn2","x":450,"y":-80,"group":"2c65bc40ccecfb45","id":"2c7bb48a148e5742","entityClassId":15364132,"spawnX":0,"spawnY":0},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":90,"y":-80,"group":"2c65bc40ccecfb45","id":"2c7c4bbf45d7b042","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":90,"y":16,"group":"2c65bc40ccecfb45","id":"2c7c5ce2b56de74f","targetId":0,"prop":"y","version":2}],"links":[{"input_id":"2c77a68d5263434ai0","output_id":"2c75e7b817ad7543o0"},{"input_id":"2c77a4c821479e40i0","output_id":"2c75e8394c1d1f4co0"},{"input_id":"2c77a4c821479e40i1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c77a68d5263434ai1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c78a73aa9fc1346i0","output_id":"2c767dc7ea224349o0"},{"input_id":"2c77309ebf05c649i1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c76cb26ef72ab4fi0","output_id":"2c77901db8961545o0"},{"input_id":"2c76cb26ef72ab4fi1","output_id":"2c77309ebf05c649o0"},{"input_id":"2c76cb26ef72ab4fi2","output_id":"2c7c4bbf45d7b042o0"},{"input_id":"2c76cb26ef72ab4fi3","output_id":"2c77309ebf05c649o0"},{"input_id":"2c7bb48a148e5742i0","output_id":"2c76cb26ef72ab4fo0"},{"input_id":"2c76d7c1b2628f47i0","output_id":"2c77901db8961545o0"},{"input_id":"2c76d7c1b2628f47i1","output_id":"2c77309ebf05c649o0"},{"input_id":"2c76d7c1b2628f47i2","output_id":"2c7c5ce2b56de74fo0"},{"input_id":"2c76d7c1b2628f47i3","output_id":"2c77309ebf05c649o0"},{"input_id":"2c7bb48a148e5742i1","output_id":"2c76d7c1b2628f47o0"},{"input_id":"2c7bb48a148e5742i2","output_id":"2c76d7c1b2628f47o0"},{"input_id":"2c77309ebf05c649i0","output_id":"2c77309ebf05c649o0"},{"input_id":"2c77309ebf05c649i1","output_id":"2c78a73aa9fc1346o0"},{"input_id":"2c77309ebf05c649i1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c76cb26ef72ab4fi1","output_id":"2c77309ebf05c649o0"},{"input_id":"2c76cb26ef72ab4fi3","output_id":"2c77309ebf05c649o0"},{"input_id":"2c76d7c1b2628f47i1","output_id":"2c77309ebf05c649o0"},{"input_id":"2c76d7c1b2628f47i3","output_id":"2c77309ebf05c649o0"},{"input_id":"2c77309ebf05c649i0","output_id":"2c77309ebf05c649o0"},{"input_id":"2c77901db8961545i0","output_id":"2c77a4c821479e40o0"},{"input_id":"2c77901db8961545i1","output_id":"2c77a68d5263434ao0"},{"input_id":"2c76cb26ef72ab4fi0","output_id":"2c77901db8961545o0"},{"input_id":"2c76d7c1b2628f47i0","output_id":"2c77901db8961545o0"},{"input_id":"2c77a4c821479e40i0","output_id":"2c75e8394c1d1f4co0"},{"input_id":"2c77a4c821479e40i1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c77901db8961545i0","output_id":"2c77a4c821479e40o0"},{"input_id":"2c7c4bbf45d7b042i0","output_id":"2c77a4c821479e40o0"},{"input_id":"2c77a68d5263434ai0","output_id":"2c75e7b817ad7543o0"},{"input_id":"2c77a68d5263434ai1","output_id":"2c767dc7ea224349o0"},{"input_id":"2c77901db8961545i1","output_id":"2c77a68d5263434ao0"},{"input_id":"2c7c5ce2b56de74fi0","output_id":"2c77a68d5263434ao0"},{"input_id":"2c78a73aa9fc1346i0","output_id":"2c767dc7ea224349o0"},{"input_id":"2c77309ebf05c649i1","output_id":"2c78a73aa9fc1346o0"},{"input_id":"2c7bb48a148e5742i0","output_id":"2c76cb26ef72ab4fo0"},{"input_id":"2c7bb48a148e5742i1","output_id":"2c76d7c1b2628f47o0"},{"input_id":"2c7bb48a148e5742i2","output_id":"2c76d7c1b2628f47o0"},{"input_id":"2c7c4bbf45d7b042i0","output_id":"2c77a4c821479e40o0"},{"input_id":"2c76cb26ef72ab4fi2","output_id":"2c7c4bbf45d7b042o0"},{"input_id":"2c7c5ce2b56de74fi0","output_id":"2c77a68d5263434ao0"},{"input_id":"2c76d7c1b2628f47i2","output_id":"2c7c5ce2b56de74fo0"}]}}}

can I have the game link pretty please

1 Like

Sure, though it’s a mess of just random tests.

Go to the last level in the “!Bundles” object. There is a bundle labeled “Coding Challenge”, it’s next to the Once.

@Flying_Fajita is the first one to get it, but @CodeAlpaca are wright too. Using an ease would simplify this too, but yeah I was looking for methods with cos and sin because not only does it help with a wave of spikes, I also used the unit circle with disance to spawn accorns in the day scenes in the boss fight where the angle is randomized from the center location.

Answer

image

Exrepssion Cos X
(C*Math.cos(B*(Math.PI/180)))+A

Expression Sin Y
(C*Math.sin(B*(Math.PI/180)))+A

// A = This X/Y
// B = Angle
// C = Distance
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":3,"outputCount":1,"name":"Spawn","behaviorType":"logic.components.Spawn2","x":540,"y":-80,"id":"35a6a13d53c32242","entityClassId":19255613,"spawnX":0,"spawnY":0},{"expression":"(C*Math.sin(B*(Math.PI/180)))+A","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":3,"version":2,"tag":"Sin Y","inputCount":4,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":360,"y":48,"id":"35a6a13f1e1d7b4e"},{"expression":"(C*Math.cos(B*(Math.PI/180)))+A","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":3,"version":2,"tag":"Cos X","inputCount":4,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":360,"y":-80,"id":"35a6a13f6d705c40","notes":"A = Starting Location\nB = Angle\nC = Distance","n_o":1},{"expression":"A*32","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"Distance","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":180,"y":48,"id":"35a6a13f870ebc4d"},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":0,"y":-288,"id":"35a6a13fe3a19c4e","resetOnLevelStart":false},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":180,"y":-288,"id":"35a6a13fb6858244","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":180,"y":-192,"id":"35a6a13f164e2343","targetId":0,"prop":"y","version":2},{"delay":0,"count":10,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-180,"y":48,"group":"","id":"35a701402ba64a4e","notes":"0 w/ repeat 10","n_o":1},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":0,"y":-80,"group":"","id":"35a78916ca942e47","tag":"Player Y:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":0,"y":-192,"group":"","id":"35a789b26a891142","tag":"Player X:Number","version":2,"dataType":2},{"inputCount":2,"outputCount":1,"name":"PointAt","behaviorType":"logic.components.PointAt","x":180,"y":-80,"group":"","id":"35a7ae28a90bb948","skipRot":true},{"expression":"A+1>10?1:A+1","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"Count","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":0,"y":48,"group":"","id":"35a94d1069bdb041"},{"delay":20,"count":0,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-360,"y":48,"group":"","id":"35aae8801375f648","notes":"20 w/ repeat forever","n_o":1},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-360,"y":160,"group":"","id":"35abcb76afe83442","resetOnLevelStart":false}],"links":[{"input_id":"35a6a13d53c32242i0","output_id":"35a6a13f6d705c40o0"},{"input_id":"35a6a13d53c32242i1","output_id":"35a6a13f1e1d7b4eo0"},{"input_id":"35a6a13d53c32242i2","output_id":"35a6a13f1e1d7b4eo0"},{"input_id":"35a6a13f1e1d7b4ei0","output_id":"35a6a13f164e2343o0"},{"input_id":"35a6a13f1e1d7b4ei1","output_id":"35a7ae28a90bb948o0"},{"input_id":"35a6a13f1e1d7b4ei2","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13f1e1d7b4ei3","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13d53c32242i1","output_id":"35a6a13f1e1d7b4eo0"},{"input_id":"35a6a13d53c32242i2","output_id":"35a6a13f1e1d7b4eo0"},{"input_id":"35a6a13f6d705c40i0","output_id":"35a6a13fb6858244o0"},{"input_id":"35a6a13f6d705c40i1","output_id":"35a7ae28a90bb948o0"},{"input_id":"35a6a13f6d705c40i2","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13f6d705c40i3","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13d53c32242i0","output_id":"35a6a13f6d705c40o0"},{"input_id":"35a6a13f870ebc4di0","output_id":"35a94d1069bdb041o0"},{"input_id":"35a6a13f870ebc4di1","output_id":"35a94d1069bdb041o0"},{"input_id":"35a6a13f6d705c40i2","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13f6d705c40i3","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13f1e1d7b4ei2","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13f1e1d7b4ei3","output_id":"35a6a13f870ebc4do0"},{"input_id":"35a6a13fb6858244i0","output_id":"35a6a13fe3a19c4eo0"},{"input_id":"35a6a13f164e2343i0","output_id":"35a6a13fe3a19c4eo0"},{"input_id":"35a6a13fb6858244i0","output_id":"35a6a13fe3a19c4eo0"},{"input_id":"35a6a13f6d705c40i0","output_id":"35a6a13fb6858244o0"},{"input_id":"35a6a13f164e2343i0","output_id":"35a6a13fe3a19c4eo0"},{"input_id":"35a6a13f1e1d7b4ei0","output_id":"35a6a13f164e2343o0"},{"input_id":"35a701402ba64a4ei0","output_id":"35aae8801375f648o0"},{"input_id":"35a701402ba64a4ei0","output_id":"35abcb76afe83442o0"},{"input_id":"35a94d1069bdb041i1","output_id":"35a701402ba64a4eo0"},{"input_id":"35a7ae28a90bb948i1","output_id":"35a78916ca942e47o0"},{"input_id":"35a7ae28a90bb948i0","output_id":"35a789b26a891142o0"},{"input_id":"35a7ae28a90bb948i0","output_id":"35a789b26a891142o0"},{"input_id":"35a7ae28a90bb948i1","output_id":"35a78916ca942e47o0"},{"input_id":"35a6a13f6d705c40i1","output_id":"35a7ae28a90bb948o0"},{"input_id":"35a6a13f1e1d7b4ei1","output_id":"35a7ae28a90bb948o0"},{"input_id":"35a94d1069bdb041i0","output_id":"35a94d1069bdb041o0"},{"input_id":"35a94d1069bdb041i1","output_id":"35a701402ba64a4eo0"},{"input_id":"35a94d1069bdb041i0","output_id":"35a94d1069bdb041o0"},{"input_id":"35a6a13f870ebc4di0","output_id":"35a94d1069bdb041o0"},{"input_id":"35a6a13f870ebc4di1","output_id":"35a94d1069bdb041o0"},{"input_id":"35a701402ba64a4ei0","output_id":"35aae8801375f648o0"},{"input_id":"35a701402ba64a4ei0","output_id":"35abcb76afe83442o0"}]}}}
2 Likes

Make UI Controller Buttons

May 1st, 2024
Difficulty: Intermediate
(Rules)

Show a screenshot of code on how you would turn a Mouse Click into a repeating button like the keyboard behavior. This can be done with MouseClick or Gestures, and this is only to replicate button presses.

image

1 Like
Answer

Maybe I misunderstood the question?

1 Like