Log In  

Hi. I am trying to work on a game with my 10 year old daughter. One of the features she wants is for her hero to make a noise that freezes the enemy. I have found help with coding that has given me most of what I need to do but this is the last one that I can not find anything similar. Had it been done on pico8 and is it possible?
Thanks

P#77938 2020-06-11 14:33

How does this power work? Does the hero make the noise periodically, when they come close to an enemy, via button press, etc.?

Whatever triggers the ability, and whatever effect it has on the enemy, will all be done in code. When the power is triggered, you can use the sfx() function to play the appropriate sound.

Pseudocode example:

if btnp(5) then
 for e in all(enemies) do
  if enemy_in_range(e) then
   e.can_move=false
  end
 end
 --make sound regardless of whether it hits
 sfx(1)
end
P#77943 2020-06-11 15:53 ( Edited 2020-06-11 15:54)

Thank you. Just had a quick check if this does what I need and it is first step in sorting it.

P#77945 2020-06-11 16:02

[Please log in to post a comment]