You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is camera shake however, i think a sprite shake would be useful aswell
a shake function for the (sprite component? really anything that can be drawn)
you would use the function with an intensity parameter, and an optional duration parameter, and the sprite would then shake back and forth without changing the transform of the area
giving all other objects a fixed() component and then doing camShake()
I'm not sure if the duration parameter would be necessary.
The text was updated successfully, but these errors were encountered:
this is a cool idea, could make it like only shake X axis or Y or both, about the duration it could use the same parameters as the improved shake i suggested
/*** Shakes an object* @param initialPos The position it initially was at * @param time How long will it shake for* @param strength The strength of the shake (how much it will move in pixels)* @param interval How long between each shake*/shakePanic(initialPos: Vec2,time?: number,strength?: number,interval?: number) : shakePanicReturnType{time=time??1strength=strength??10interval=interval??0.05letshakeLoop=this.loop(interval,()=>{constnewPos=initialPos.add(rand(-strength,strength),rand(-strength,strength))this.pos=newPos})functioncancelFunction(){shakeLoop.cancel()this.pos=initialPos}this.wait(time,cancelFunction)return{cancel: cancelFunction}}
there is camera shake however, i think a sprite shake would be useful aswell
a shake function for the (sprite component? really anything that can be drawn)
you would use the function with an intensity parameter, and an optional duration parameter, and the sprite would then shake back and forth without changing the transform of the area
giving all other objects a fixed() component and then doing camShake()
I'm not sure if the duration parameter would be necessary.
The text was updated successfully, but these errors were encountered: