Discord
Login
Community
DARK THEME

ENEMIE

hi, i tried to do a code for the quick enemyes move but doens't worked, can you help me? https://microstudio.dev/i/warrior/lipesadventure/

And also, i maked a ladder to the player go up but i make this simple code

for l in ladder
  if Quick.spriteCollision(lipe.sprite,l) and keyboard.UP or keyboard.X then
    lipe.sprite.y += 1
    Quick.friction = 100
  else
    Quick.friction = 2
  end
end

the code is working, the only wrong thing is when the player collide with the ladder end go out of her hit box, the friction still 100, the friction don't return to 2, plis i need help

file >> lipe >> function >> update

    local test_climb = false
    for l in ladder
      if Quick.spriteCollision(this.sprite, l) then
        this.sprite.name = "lipe_climb"
        test_climb = true
      end
    end
    if test_climb then 
      this.sprite.fall = false
      if keyboard.UP then
        this.sprite.ay += 20 
      end
    else 
      this.sprite.fall = true
    end

Don't change the friction value. Throw away the ladder detection code from main .

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community