Hey guys,
I need help with making a Boss Battle in my new game. Can anyone try to send screenshots of the coding part needed to do this?
Can you describe the desired boss battle?
I want it to be able to move around, and spawn little minions when the player gets close.
You could use proximity or raycaster for that.
Follow the player? Is the game top-down?
I’m not sure what top-down is, but the game is 2D and you can only move up, down, left, and right. No depth.
Ok, so it’s top down. I have a boss in my new game that follows the player. It’s quite easy to make it spawn enemies. Think about it. If it needs to follow the player, what behaviors do you need?
Point at? I’m not sure
Yeah. Use an always to get the player X and Y using an extractor and then attach it to set on two globals:
Here’s an example. This code should go int he player. It can be used to make anything point at you.
Once you’re done with this, tag me and I’ll show the you other half of the following concept.
I see, you can continue.
Here is the code for the object that is supposed to follow the player.
Here, import it:
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":2,"name":"In View","behaviorType":"logic.triggers.InView","x":-360,"y":32,"group":"bd64a1650f79914d","id":"bd64c9bfb7329e4b","buffer":96},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":-32,"group":"bd64a1650f79914d","id":"bd65110db080304d","startVal":0.6,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-180,"y":-32,"group":"bd64a1650f79914d","id":"bd654484a69e654d","_startVal":1,"dataType":2},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-360,"y":-32,"group":"bd64a1650f79914d","id":"bd8b992039f8b445"},{"inputCount":2,"outputCount":2,"name":"AngleToSpeed","behaviorType":"logic.NodeGroup","x":180,"y":-64,"group":"bd64a1650f79914d","id":"c7d1712252973547","notes":null,"isMenuItem":false},{"expression":"B*Math.cos(A*(Math.PI/180))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":1,"tag":"Cos","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":720,"y":640,"group":"c7d1712252973547","id":"c7d171250a71f74b"},{"expression":"B*Math.sin(A*(Math.PI/180))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":1,"tag":"Sin","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":720,"y":768,"group":"c7d1712252973547","id":"c7d171257e78d544"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":360,"y":640,"group":"c7d1712252973547","id":"c7d1712524393b44","portId":"c7d1712252973547i0","tag":"Angle","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":768,"group":"c7d1712252973547","id":"c7d17126d1572c4a","portId":"c7d1712252973547i1","tag":"Speed","dataType":2},{"expression":"((A%360)+360)%360","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":1,"tag":"Angle","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":540,"y":640,"group":"c7d1712252973547","id":"c7d17126d940cf4e"},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":640,"group":"c7d1712252973547","id":"c7d17126c02b124d","portId":"c7d1712252973547o0","tag":"X","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":768,"group":"c7d1712252973547","id":"c7d17126f6c0294c","portId":"c7d1712252973547o1","tag":"Y","dataType":2},{"inputCount":3,"outputCount":3,"name":"Velocity","behaviorType":"logic.properties.Physics","x":360,"y":-64,"group":"bd64a1650f79914d","id":"bd6598c9e8515440"},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-180,"y":-224,"group":"bd64a1650f79914d","id":"c7d2c9bfa45d704c","tag":"Player X:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":-180,"y":-128,"group":"bd64a1650f79914d","id":"c7d2ca70a002b44e","tag":"Player Y:Number","version":2,"dataType":2},{"inputCount":2,"outputCount":1,"name":"PointAt","behaviorType":"logic.components.PointAt","x":0,"y":-160,"group":"bd64a1650f79914d","id":"c7d31a74991c0c47","skipRot":true}],"links":[{"input_id":"bd654484a69e654di1","output_id":"bd64c9bfb7329e4bo0"},{"input_id":"bd65110db080304di1","output_id":"bd654484a69e654do0"},{"input_id":"c7d1712252973547i1","output_id":"bd65110db080304do0"},{"input_id":"bd654484a69e654di1","output_id":"bd64c9bfb7329e4bo0"},{"input_id":"bd654484a69e654di2","output_id":"bd8b992039f8b445o0"},{"input_id":"bd65110db080304di1","output_id":"bd654484a69e654do0"},{"input_id":"c7d2c9bfa45d704ci1","output_id":"bd8b992039f8b445o0"},{"input_id":"c7d2ca70a002b44ei1","output_id":"bd8b992039f8b445o0"},{"input_id":"bd654484a69e654di2","output_id":"bd8b992039f8b445o0"},{"input_id":"c7d1712252973547i0","output_id":"c7d31a74991c0c47o0"},{"input_id":"c7d1712252973547i1","output_id":"bd65110db080304do0"},{"input_id":"bd6598c9e8515440i0","output_id":"c7d1712252973547o0"},{"input_id":"bd6598c9e8515440i1","output_id":"c7d1712252973547o1"},{"input_id":"bd6598c9e8515440i0","output_id":"c7d1712252973547o0"},{"input_id":"bd6598c9e8515440i1","output_id":"c7d1712252973547o1"},{"input_id":"c7d2c9bfa45d704ci1","output_id":"bd8b992039f8b445o0"},{"input_id":"c7d31a74991c0c47i0","output_id":"c7d2c9bfa45d704co0"},{"input_id":"c7d2ca70a002b44ei1","output_id":"bd8b992039f8b445o0"},{"input_id":"c7d31a74991c0c47i1","output_id":"c7d2ca70a002b44eo0"},{"input_id":"c7d31a74991c0c47i0","output_id":"c7d2c9bfa45d704co0"},{"input_id":"c7d31a74991c0c47i1","output_id":"c7d2ca70a002b44eo0"},{"input_id":"c7d1712252973547i0","output_id":"c7d31a74991c0c47o0"},{"input_id":"c7d17126c02b124di0","output_id":"c7d171250a71f74bo0"},{"input_id":"c7d17126f6c0294ci0","output_id":"c7d171257e78d544o0"},{"input_id":"c7d17126d940cf4ei0","output_id":"c7d1712524393b44o0"},{"input_id":"c7d17126d940cf4ei1","output_id":"c7d1712524393b44o0"},{"input_id":"c7d171250a71f74bi1","output_id":"c7d17126d1572c4ao0"},{"input_id":"c7d171250a71f74bi2","output_id":"c7d17126d1572c4ao0"},{"input_id":"c7d171257e78d544i1","output_id":"c7d17126d1572c4ao0"},{"input_id":"c7d171257e78d544i2","output_id":"c7d17126d1572c4ao0"},{"input_id":"c7d171250a71f74bi0","output_id":"c7d17126d940cf4eo0"},{"input_id":"c7d171257e78d544i0","output_id":"c7d17126d940cf4eo0"}]}}}
Oh, cool. You are so helpful. Thank you!!!
Now for the spawning of the minions.
We need it to spawn on both sides of the boss, meaning that we need the bosses Y.
Why just Y? It should be able to spawn in all 4 directions?
If it were to spawn in all four directions, there could be a chance that one of the minions would be stuck.
Stuck in what aspect?
The ground, or something similar.
Then use raycasts to check if there is an object there. If there isn’t then spawn.
It does not work. What aspect am I supposed to put this code in?
Oh, ok. I thought you just wanted it on both sides.