Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

itch.ioitch.io logo & titleitch.io logo

Browse GamesGame JamsUpload GameDeveloper LogsCommunity
Log inRegister
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Superpowers

Created bySparklin Labs
0
Members

Wait function

So, how do i make superpowers wait? Simple as that. I just wanna make it so that the game drops a platform using gravity, waits a few seconds, and then bring the platform back to it's original position, and then finally lock it. What function can i use for the wait function?

lucky you,  i just connect myself. Here what i know:

Sup.setTimeout(1000ms,Nameofthefunction) // Wait and then call a function Sup.setInterval(1000ms,Nameofthefunction) // Wait and then call a function every 1000ms => use clearIntervall for end it (for timeout too)

And here a tips :

Use a local funtion, like that you can call it while the var it use are not deletes

function (Enemie: Actor[]){ let idE = 0  function KillEnemie() // the local one  { Actor[idE].destroy()   idE++   Sup.setTimeout(1000ms,KillEnemie)  } }

 with love, me.

Hey, for some reason, it's not resetting the platform at all! Here's the code, lemme know if i used it wrong.

    if (this.actor.arcadeBody2D.getTouches().top)
    {
        this.actor.arcadeBody2D.setCustomGravityY(-0.01)
        Sup.setTimeout(1000, returnPlatform)
        
    }
  function returnPlatform()
  {
    this.actor.arcadeBody2D.setCustomGravityY(0)
    this.actor.setPosition(this.pos)
    Sup.clearTimeout(0)
  }

HeySo the platform start to go down and stop ?What is the variable pos ?

With your code the platform will go downward and after 1 second stop to go downward and teleport to ‘this.pos’

that's what i intended but it didn't work

Log in to reply Join the discussion. Log in or create a free itch.io account to continue.
itch.io on Twitteritch.io on Facebook
AboutFAQBlogContact us
Copyright © 2025 itch corp ·Directory ·Terms ·Privacy ·Cookies

[8]ページ先頭

©2009-2025 Movatter.jp