• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED How do I make a chain chomp

Roderick

Member
Just make an object that is unable to move more than a certain distance from its tether. The chain is NOT an important part of its functionality; it should be added as a graphical effect.

Give it a state machine causing it to bounce around on the ground (within range of its tether) when idle, and a lunge state where it launches itself out to maximum range. Possibly add a third state so it hovers and chomps when it reaches the end of its lunge, before dropping back to the ground in its idle state.

For the chain, just draw a few links evenly spaced between the objectand point of origin. For a more realistic dangle, have them hang progressively lower (but notbelow ground level) the closer they are to the center.
 
R

Randon

Guest
@Roderick thank you so much :D
Edit: the chain chomp is buggy, but i don't plan it bouncing from the ground, here is the code, can you correct it please
-----------------------------------------------------------------------------------------------------------
if instance_exists(objTether){
if distance_to_object(objTether) > 160 {speed = 0}}
if instance_exists(objPlayer){
if distance_to_object(objPlayer) < 128 {move_towards_point(objPlayer.x,objPlayery,6)}else{speed = 0}}
if instance_exists(objTether) && instance_exists(objPlayer){
if distance_to_object(objTether) > 160 && distance_to_object(objPlayer) < 128 {speed = -1}}

-------------------------------------------
Edit: I found the solution
 
Last edited by a moderator:
Top