-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.json.autosave
1 lines (1 loc) · 101 KB
/
game.json.autosave
1
{"firstLayout":"","gdVersion":{"build":99,"major":4,"minor":0,"revision":0},"properties":{"adaptGameResolutionAtRuntime":true,"folderProject":false,"orientation":"landscape","packageName":"com.example.gamename","pixelsRounding":false,"projectUuid":"1f5516fb-93c6-40dd-bf65-d329dddd3d25","scaleMode":"linear","sizeOnStartupMode":"adaptHeight","templateSlug":"","useExternalSourceFiles":false,"version":"1.0.0","name":"MTubie","description":"(MimeTubie )An open source PNGTuber template you can use to create custom PNGTuber models using Visual-Scripting (Event sheet). You can make either Tweened or import frame by frame animations!\n\nYou Got Frame by frame (FBF) and Tweening Scenes as template to what you can do. It is easy to use. Enjoy your time.\n(Make sure to read the comments in the code ^^)\n\nSpecial thanks to : \n- Arthuro (For making the Microphone extension)\n- VictrisGames (For making the ShakeObject extension)","author":"","windowWidth":1360,"windowHeight":720,"latestCompilationDirectory":"E:\\Gdev\\BlueTubie\\exp","maxFPS":60,"minFPS":20,"verticalSync":false,"platformSpecificAssets":{"android-icon-144":"","android-icon-192":"","android-icon-36":"","android-icon-48":"","android-icon-72":"","android-icon-96":"","android-windowSplashScreenAnimatedIcon":"","desktop-icon-512":"ModelIcon.png","ios-icon-100":"","ios-icon-1024":"","ios-icon-114":"","ios-icon-120":"","ios-icon-144":"","ios-icon-152":"","ios-icon-167":"","ios-icon-180":"","ios-icon-20":"","ios-icon-29":"","ios-icon-40":"","ios-icon-50":"","ios-icon-57":"","ios-icon-58":"","ios-icon-60":"","ios-icon-72":"","ios-icon-76":"","ios-icon-80":"","ios-icon-87":"","liluo-thumbnail":""},"loadingScreen":{"backgroundColor":0,"backgroundFadeInDuration":0.2,"backgroundImageResourceName":"","gdevelopLogoStyle":"light","logoAndProgressFadeInDuration":0.2,"logoAndProgressLogoFadeInDelay":0.2,"minDuration":1.5,"progressBarColor":16777215,"progressBarHeight":20.0,"progressBarMaxWidth":200.0,"progressBarMinWidth":40.0,"progressBarWidthPercent":30.0,"showGDevelopSplash":false,"showProgressBar":true},"watermark":{"placement":"bottom-left","showWatermark":false},"authorIds":[],"authorUsernames":[],"categories":[],"playableDevices":[],"extensionProperties":[],"platforms":[{"name":"GDevelop JS platform"}],"currentPlatform":"GDevelop JS platform"},"resources":{"resources":[{"alwaysLoaded":false,"file":"EyesOpen2.png","kind":"image","metadata":"","name":"EyesOpen2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"EyesClosed3.png","kind":"image","metadata":"","name":"EyesClosed3.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"EyesClosed-12.png","kind":"image","metadata":"","name":"EyesClosed-12.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"EyesClosed-2.png","kind":"image","metadata":"","name":"EyesClosed-2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"EyesClosedExcited.png","kind":"image","metadata":"","name":"EyesClosedExcited.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"MouthClosed2.png","kind":"image","metadata":"","name":"MouthClosed2.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"MouthOpen2.png","kind":"image","metadata":"","name":"MouthOpen2.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"MouthOpen-22.png","kind":"image","metadata":"","name":"MouthOpen-22.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"MouthOpenExcited.png","kind":"image","metadata":"","name":"MouthOpenExcited.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"ModelIcon.png","kind":"image","metadata":"","name":"ModelIcon.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Head.png","kind":"image","metadata":"","name":"Head.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Body.png","kind":"image","metadata":"","name":"Body.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"RightEar.png","kind":"image","metadata":"","name":"RightEar.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"LeftEar.png","kind":"image","metadata":"","name":"LeftEar.png","smoothed":true,"userAdded":true},{"file":"CaveatBrush-Regular.ttf","kind":"font","metadata":"","name":"CaveatBrush-Regular.ttf","userAdded":false},{"alwaysLoaded":false,"file":"Creature 1.png","kind":"image","metadata":"","name":"Creature 1.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Creature 2.png","kind":"image","metadata":"","name":"Creature 2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Creature 3.png","kind":"image","metadata":"","name":"Creature 3.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Creature 4.png","kind":"image","metadata":"","name":"Creature 4.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Creature 5.png","kind":"image","metadata":"","name":"Creature 5.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Creature 6.png","kind":"image","metadata":"","name":"Creature 6.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Creature 7.png","kind":"image","metadata":"","name":"Creature 7.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Creature 8.png","kind":"image","metadata":"","name":"Creature 8.png","smoothed":true,"userAdded":false}],"resourceFolders":[]},"objects":[],"objectsGroups":[],"variables":[],"layouts":[{"b":88,"disableInputWhenNotFocused":false,"mangledName":"TweenScene","name":"TweenScene","r":88,"standardSortMethod":true,"stopSoundsOnStartup":true,"title":"TzTube","v":88,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.5268756481119833,"windowMask":false},"objectsGroups":[{"name":"Character","objects":[{"name":"Head"},{"name":"Eyes"},{"name":"Body"},{"name":"Mouth"},{"name":"RightEar"},{"name":"LeftEar"}]},{"name":"WholeHead","objects":[{"name":"Head"},{"name":"Eyes"},{"name":"Mouth"},{"name":"RightEar"},{"name":"LeftEar"}]}],"variables":[{"folded":true,"name":"Speech","type":"boolean","value":false},{"folded":true,"name":"Path","type":"string","value":""}],"instances":[{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"Head","persistentUuid":"1217c685-79d7-468e-a3b7-b4253f816df2","width":540.0,"x":679.0,"y":717.0,"zOrder":11,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"Body","persistentUuid":"593656f6-acaf-4e35-8d5e-f45c0149b958","width":540.0,"x":669.0,"y":728.0,"zOrder":5,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"Eyes","persistentUuid":"e9cc9e71-d1ff-4230-a841-d75bfe117f3c","width":540.0,"x":679.0,"y":717.0,"zOrder":13,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"Mouth","persistentUuid":"551278ed-354e-40aa-858f-9a3145af8b3e","width":540.0,"x":679.0,"y":717.0,"zOrder":14,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"RightEar","persistentUuid":"e5557616-4a7d-4b1f-952d-8bc3ffb81aa1","width":540.0,"x":669.0,"y":717.0,"zOrder":11,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":540.0,"layer":"","name":"LeftEar","persistentUuid":"91ff46f6-353c-4402-aa44-a7523491b987","width":540.0,"x":669.0,"y":717.0,"zOrder":9,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":420.0,"layer":"","name":"Info","persistentUuid":"00ad98fc-30f4-4078-8000-0e7cdb18d1f3","width":372.0,"x":976.0,"y":10.0,"zOrder":15,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","name":"Head","tags":"","type":"Sprite","updateIfNotVisible":true,"variables":[{"folded":true,"name":"Swing","type":"boolean","value":false}],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Head.png","points":[],"originPoint":{"name":"origine","x":517.1568627450981,"y":995.0980392156863},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"Body","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Body.png","points":[],"originPoint":{"name":"origine","x":495.0980392156863,"y":1002.4509803921569},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"Eyes","tags":"","type":"Sprite","updateIfNotVisible":true,"variables":[],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"Open","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.25,"sprites":[{"hasCustomCollisionMask":false,"image":"EyesOpen2.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"Closing","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"EyesClosed-12.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"EyesClosed3.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"EyesClosed-2.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"EyesOpen2.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"EyesClosed","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"EyesClosedExcited.png","points":[],"originPoint":{"name":"origine","x":518.8039,"y":1000.0000000000001},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"Mouth","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"Closed","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"MouthClosed2.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"MouthOpen","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"MouthOpen2.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"MouthOpen-22.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"WideOpen","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"MouthOpenExcited.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"RightEar","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"RightEar.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"LeftEar","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"LeftEar.png","points":[],"originPoint":{"name":"origine","x":517.902,"y":995.098},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","bold":false,"italic":false,"name":"Info","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Check the Events for the code!\n\n(This text will be hidden upon start)","font":"CaveatBrush-Regular.ttf","textAlignment":"left","characterSize":60.0,"color":{"b":0,"g":0,"r":0}}],"events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":128,"g":105,"r":118,"textB":255,"textG":255,"textR":255},"comment":"Hello!, this is the code for scene. This is where the character is given commands to do stuff!\n\nA small intro : \nThe comments made in this project are for both beginners, people who just used Gdevelop for the first time and people wanting to understand what is the function for each thing!\nI hope you don't mind how detailed it is ^^\n\n-Click on the arrows beside the event groups to open them\n-If you find any code that is crossed, right-click it and click \"Toggle disabled\". This works if you want to enable or disable your code\n-If you have any problems with the code, make sure to check Gdevelop's official youtube channel! \" https://www.youtube.com/@GDevelopApp \"","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":124,"g":90,"r":111,"textB":255,"textG":255,"textR":255},"comment":"The Scene on top will always start first, make sure if you will use the frame by frame one, make sure it is the top one\nMake sure to check the sprites from the editor itself. Double click on the sprites in the \"Object\" Tab to check them out!\nYou can ofc remove all the tweens if you just want a still image with no movement\nFinal note (for now lol), If you want to make a \"pixel\" character, make sure to go to properties and click on the \"Round pixels\" and set the scaling to \"Nearest\"","comment2":""},{"colorB":0,"colorG":157,"colorR":250,"creationTime":0,"folded":true,"name":"Start","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This is the first code that gets excuted when starting the scene for the first time. This means it won't run again unless you restarted the whole scene.\nThis is very important since it will be used to start all the tweens and have the initial actions you need/ want to run at first!\n\n-Also, the \"WholeHead\" is a group that contains parts of the head, this can be helpful to animate parts all in one code. However, it is better if these parts had the same canvas size (no matter their size), so they all move together the exact same)","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"DepartScene"},"parameters":[""]}],"actions":[{"type":{"value":"Cache"},"parameters":["Info"]},{"type":{"value":"Wait"},"parameters":["0.2"]},{"type":{"value":"Microphone::requestMicrophoneAccess"},"parameters":["",""]},{"type":{"value":"ResetObjectTimer"},"parameters":["Eyes","\"Blink\""]},{"type":{"value":"Tween::AddObjectPositionYTween"},"parameters":["WholeHead","Tween","\"GoDown\"","725","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectHeightTween"},"parameters":["Body","Tween","\"GoDown\"","450","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["RightEar","Tween","\"RotLeft\"","-5","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["LeftEar","Tween","\"RotRight\"","5","\"easeInOutQuad\"","1200",""]}]}],"parameters":[]},{"colorB":86,"colorG":172,"colorR":56,"creationTime":0,"folded":true,"name":"Animation","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This is a basic and really easy way to tween your character. However, if you want to make things move at different times, it is better to make different code for them\nWhen the tween finishes, the other plays and when the other finishes, the first plays, like that, it is all in a smooth loop!","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Tween::HasFinished"},"parameters":["WholeHead","Tween","\"GoDown\""]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"Tween::AddObjectPositionYTween"},"parameters":["WholeHead","Tween","\"GoUp\"","717","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectHeightTween"},"parameters":["Body","Tween","\"GoUp\"","540","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["RightEar","Tween","\"RotRight\"","5","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["LeftEar","Tween","\"RotLeft\"","-5","\"easeInOutQuad\"","1200",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Tween::HasFinished"},"parameters":["WholeHead","Tween","\"GoUp\""]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"Tween::AddObjectPositionYTween"},"parameters":["WholeHead","Tween","\"GoDown\"","725","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectHeightTween"},"parameters":["Body","Tween","\"GoDown\"","450","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["RightEar","Tween","\"RotLeft\"","-5","\"easeInOutQuad\"","1200",""]},{"type":{"value":"Tween::AddObjectAngleTween"},"parameters":["LeftEar","Tween","\"RotRight\"","5","\"easeInOutQuad\"","1200",""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This is a timer that is set to a random window frame between 2 to 6 seconds (will randomly choose, let's say, second number 3 and then the action will get excuted)","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"CompareObjectTimer"},"parameters":["Eyes","\"Blink\"",">","RandomInRange(2,6)"]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"SetAnimationName"},"parameters":["Eyes","\"Closing\""]},{"type":{"value":"ResetObjectTimer"},"parameters":["Eyes","\"Blink\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"After the animation of the eyes blinking finishes, it will go back to being set to eyes open","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"AnimationName"},"parameters":["Eyes","\"Closing\""]},{"type":{"value":"AnimationEnded2"},"parameters":["Eyes"]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"SetAnimationName"},"parameters":["Eyes","\"Open\""]}]}],"parameters":[]},{"colorB":152,"colorG":162,"colorR":73,"creationTime":0,"folded":true,"name":"Microphone","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This code checks if your sound/ voice input in the microphone is high enough to a certain point. If the sound is higher than the number set, the mouth opens. If it is even higher, the mouth opens more. If it is lower, the mouth closes","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()",">","0.018"]}],"actions":[{"type":{"value":"SetAnimationName"},"parameters":["Mouth","\"MouthOpen\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()",">","0.16"]}],"actions":[{"type":{"value":"SetAnimationName"},"parameters":["Mouth","\"WideOpen\""]},{"type":{"value":"SetAnimationName"},"parameters":["Eyes","\"EyesClosed\""]},{"type":{"value":"ShakeObject::ShakeObject_PositionAngle::ShakeObject_PositionAngle"},"parameters":["Character","ShakeObject_PositionAngle","0.5","1","1","2","0.08","",""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()","<=","0.018"]}],"actions":[{"type":{"value":"SetAnimationName"},"parameters":["Mouth","\"Closed\""]},{"type":{"value":"ShakeObject::ShakeObject_PositionAngle::StopShaking"},"parameters":["Character","ShakeObject_PositionAngle",""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[]}],"parameters":[]},{"colorB":179,"colorG":62,"colorR":174,"creationTime":0,"folded":true,"name":"Background color","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Green screen \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"0;255;33\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Blue screen (Currently used one) \nVVV","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"0;33;255\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Magenta screen \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"255;0;240\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Red screen \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"255;0;0\""]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"folded":true,"name":"Model Visibility","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"If you don't have more than one monitor, make sure to use/ enable this code below. \nWhat it does it that it makes the model always on the top of the screen and position it at the far bottom right of the screen. \nThis way, the model is still working and hidden off the screen!\n\nThis is the current way I was able to find for now. If someone contributed and helped me with this issue. I will be very thankful! lol","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"AdvancedWindow::SetAlwaysOnTop"},"parameters":["yes","\"screen-saver\"",""]},{"type":{"value":"SetWindowSize"},"parameters":["yes","1925","1085",""]},{"type":{"value":"AdvancedWindow::SetWindowPosition"},"parameters":["1915","1070",""]}]}],"parameters":[]}],"layers":[{"ambientLightColorB":0,"ambientLightColorG":7952960,"ambientLightColorR":16,"followBaseLayerCamera":false,"isLightingLayer":false,"name":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]}],"behaviorsSharedData":[{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"}]},{"b":133,"disableInputWhenNotFocused":true,"mangledName":"FBFScene","name":"FBFScene","r":133,"standardSortMethod":true,"stopSoundsOnStartup":true,"title":"","v":133,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.5147058823529411,"windowMask":false},"objectsGroups":[],"variables":[],"instances":[{"angle":0.0,"customSize":true,"height":594.0,"layer":"","name":"Creature","persistentUuid":"6507bb9a-1b0e-4daf-8f9d-cd7760b136e3","width":594.0,"x":664.0,"y":722.0,"zOrder":1,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","name":"Creature","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[{"folded":true,"name":"CurrentFrame","type":"number","value":0.0}],"effects":[],"behaviors":[{"name":"ShakeObject_PositionAngleScale","type":"ShakeObject::ShakeObject_PositionAngleScale"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.15,"sprites":[{"hasCustomCollisionMask":false,"image":"Creature 1.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 2.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 3.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 4.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"Talking","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.15,"sprites":[{"hasCustomCollisionMask":false,"image":"Creature 5.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 6.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 7.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"Creature 8.png","points":[],"originPoint":{"name":"origine","x":510.0,"y":1000.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]}],"events":[{"colorB":0,"colorG":157,"colorR":250,"creationTime":0,"folded":true,"name":"Start","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This is the first code that gets excuted when starting the scene for the first time. This means it won't run again unless you restarted the whole scene.\nThis is very important since it will be used to start all the tweens and have the initial actions you need/ want to run at first!\n\n-Also, the \"WholeHead\" is a group that contains parts of the head, this can be helpful to animate parts all in one code. However, it is better if these parts had the same canvas size (no matter their size), so they all move together the exact same)","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"DepartScene"},"parameters":[""]}],"actions":[{"type":{"value":"Wait"},"parameters":["0.2"]},{"type":{"value":"Microphone::requestMicrophoneAccess"},"parameters":["",""]},{"type":{"value":"SetAnimationName"},"parameters":["Creature","\"Idle\""]}]}],"parameters":[]},{"colorB":152,"colorG":162,"colorR":73,"creationTime":0,"folded":true,"name":"Microphone","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"You can add the shouting animation if you want, I already demonstrated how it works in the other scene, and shaking too!","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"This code checks if your sound/ voice input in the microphone is high enough to a certain point. If the sound is higher than the number set, the mouth opens. If it is even higher, the mouth opens more. If it is lower, the mouth closes","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()",">","0.018"]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Creature","CurrentFrame","=","Creature.AnimationFrameCount()"]},{"type":{"value":"SetAnimationName"},"parameters":["Creature","\"Talking\""]},{"type":{"value":"ChangeHeight"},"parameters":["Creature","=","550"]},{"type":{"value":"Tween::AddObjectHeightTween"},"parameters":["Creature","Tween","\"Normal\"","594","\"easeInOutQuad\"","50",""]},{"type":{"value":"ChangeSprite"},"parameters":["Creature","=","Creature.Variable(CurrentFrame)"]}],"events":[{"disabled":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ShakeObject::ShakeObject_PositionAngleScale::ShakeObject_PositionAngleScale"},"parameters":["Creature","ShakeObject_PositionAngleScale","0.5","2","2","2","0","0.08","yes",""]}]}]},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()",">","0.16"]}],"actions":[]},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["Microphone::Loundness()","<=","0.018"]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Creature","CurrentFrame","=","Creature.AnimationFrameCount()"]},{"type":{"value":"SetAnimationName"},"parameters":["Creature","\"Idle\""]},{"type":{"value":"ChangeHeight"},"parameters":["Creature","=","550"]},{"type":{"value":"Tween::AddObjectHeightTween"},"parameters":["Creature","Tween","\"Normal\"","594","\"easeInOutQuad\"","50",""]},{"type":{"value":"ChangeSprite"},"parameters":["Creature","=","Creature.Variable(CurrentFrame)"]}],"events":[{"disabled":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ShakeObject::ShakeObject_PositionAngleScale::StopShaking"},"parameters":["Creature","ShakeObject_PositionAngleScale",""]}]}]}],"parameters":[]},{"colorB":179,"colorG":62,"colorR":174,"creationTime":0,"name":"Background color","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Green screen \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"0;255;33\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Blue screen (Currently used one) \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"0;33;255\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Magenta screen \nVVV","comment2":""},{"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"255;0;240\""]}]},{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Red screen \nVVV","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SceneBackground"},"parameters":["","\"255;0;0\""]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"folded":true,"name":"Model Visibility","source":"","type":"BuiltinCommonInstructions::Group","events":[{"folded":true,"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"If you don't have more than one monitor, make sure to use/ enable this code below. \nWhat it does it that it makes the model always on the top of the screen and position it at the far bottom right of the screen. \nThis way, the model is still working and hidden off the screen!\n\nThis is the current way I was able to find for now. If someone contributed and helped me with this issue. I will be very thankful! lol","comment2":""},{"disabled":true,"folded":true,"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"AdvancedWindow::SetAlwaysOnTop"},"parameters":["yes","\"screen-saver\"",""]},{"type":{"value":"SetWindowSize"},"parameters":["yes","1925","1085",""]},{"type":{"value":"AdvancedWindow::SetWindowPosition"},"parameters":["1915","1070",""]}]}],"parameters":[]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[]}],"layers":[{"ambientLightColorB":0,"ambientLightColorG":0,"ambientLightColorR":0,"followBaseLayerCamera":false,"isLightingLayer":false,"name":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]}],"behaviorsSharedData":[{"name":"ShakeObject_PositionAngleScale","type":"ShakeObject::ShakeObject_PositionAngleScale"},{"name":"Tween","type":"Tween::TweenBehavior"}]}],"externalEvents":[],"eventsFunctionsExtensions":[{"author":"Arthur Pacaud (arthuro555)","category":"","extensionNamespace":"","fullName":"Microphone","helpPath":"","iconUrl":"","name":"Microphone","previewIconUrl":"","shortDescription":"Adds actions for the microphone","version":"0.0.1","description":"Adds a set of tool to make your game interract with the players microphone","tags":["microphone","control"],"authorIds":[],"dependencies":[],"eventsFunctions":[{"description":"Requests an access to the microphone.","fullName":"Request microphone access","functionType":"Action","name":"requestMicrophoneAccess","sentence":"Request microphone access","events":[{"type":"BuiltinCommonInstructions::JsCode","inlineCode":["navigator.getUserMedia(\r"," {\r"," \"audio\": {\r"," \"mandatory\": {\r"," \"googEchoCancellation\": \"true\",\r"," \"googAutoGainControl\": \"true\",\r"," \"googNoiseSuppression\": \"true\",\r"," \"googHighpassFilter\": \"false\"\r"," },\r"," \"optional\": []\r"," },\r"," }, \r"," function(stream) {\r"," gdjs.microphone.granted = true;\r"," gdjs.microphone.mediaStream = gdjs.microphone.context.createMediaStreamSource(stream);\r"," gdjs.microphone.mediaStream.connect(gdjs.microphone.meter);\r"," },\r"," function() {gdjs.microphone.denied = true;}\r",");"],"parameterObjects":"","useStrict":true,"eventsSheetExpanded":false}],"parameters":[],"objectGroups":[]},{"fullName":"","functionType":"Action","name":"onFirstSceneLoaded","sentence":"","events":[{"type":"BuiltinCommonInstructions::JsCode","inlineCode":["window.AudioContext = window.AudioContext || window.webkitAudioContext;","navigator.getUserMedia = "," \tnavigator.getUserMedia ||"," \tnavigator.webkitGetUserMedia ||"," \tnavigator.mozGetUserMedia;","","gdjs.microphone = {};","gdjs.microphone.context = new AudioContext();","gdjs.microphone.meter = createAudioMeter(gdjs.microphone.context);","","// AudioMeter, https://github.com/cwilso/volume-meter/blob/master/volume-meter.js","function createAudioMeter(audioContext,clipLevel,averaging,clipLag) {","\tvar processor = audioContext.createScriptProcessor(512);","\tprocessor.onaudioprocess = volumeAudioProcess;","\tprocessor.clipping = false;","\tprocessor.lastClip = 0;","\tprocessor.volume = 0;","\tprocessor.clipLevel = clipLevel || 0.98;","\tprocessor.averaging = averaging || 0.95;","\tprocessor.clipLag = clipLag || 750;","","\t// this will have no effect, since we don't copy the input to the output,","\t// but works around a current Chrome bug.","\tprocessor.connect(audioContext.destination);","","\tprocessor.checkClipping =","\t\tfunction(){","\t\t\tif (!this.clipping)","\t\t\t\treturn false;","\t\t\tif ((this.lastClip + this.clipLag) < window.performance.now())","\t\t\t\tthis.clipping = false;","\t\t\treturn this.clipping;","\t\t};","","\tprocessor.shutdown =","\t\tfunction(){","\t\t\tthis.disconnect();","\t\t\tthis.onaudioprocess = null;","\t\t};","","\treturn processor;","}","","function volumeAudioProcess( event ) {","\tvar buf = event.inputBuffer.getChannelData(0);"," var bufLength = buf.length;","\tvar sum = 0;"," var x;","","\t// Do a root-mean-square on the samples: sum up the squares..."," for (var i=0; i<bufLength; i++) {"," \tx = buf[i];"," \tif (Math.abs(x)>=this.clipLevel) {"," \t\tthis.clipping = true;"," \t\tthis.lastClip = window.performance.now();"," \t}"," \tsum += x * x;"," }",""," // ... then take the square root of the sum."," var rms = Math.sqrt(sum / bufLength);",""," // Now smooth this out with the averaging factor applied"," // to the previous sample - take the max here because we"," // want \"fast attack, slow release.\""," this.volume = Math.max(rms, this.volume*this.averaging);","}",""],"parameterObjects":"","useStrict":true,"eventsSheetExpanded":true}],"parameters":[],"objectGroups":[]},{"description":"Triggers once when the access to the microphone has been denied.","fullName":"Microphone access denied","functionType":"Condition","name":"micDenied","sentence":"Microphone access denied","events":[{"type":"BuiltinCommonInstructions::JsCode","inlineCode":["eventsFunctionContext.returnValue = false;","if(gdjs.microphone.denied) {"," gdjs.microphone.denied = false;"," eventsFunctionContext.returnValue = true;","}",""],"parameterObjects":"","useStrict":true,"eventsSheetExpanded":false}],"parameters":[],"objectGroups":[]},{"description":"Triggers once when the access to the microphone has been granted.","fullName":"Microphone access granted","functionType":"Condition","name":"micGranted","sentence":"Microphone access granted","events":[{"type":"BuiltinCommonInstructions::JsCode","inlineCode":["eventsFunctionContext.returnValue = false;","if(gdjs.microphone.granted) {"," gdjs.microphone.granted = false;"," eventsFunctionContext.returnValue = true;","}",""],"parameterObjects":"","useStrict":true,"eventsSheetExpanded":false}],"parameters":[],"objectGroups":[]},{"description":"Returns the microphone loudness","fullName":"Get microphone loudness","functionType":"Expression","name":"Loundness","sentence":"","events":[{"type":"BuiltinCommonInstructions::JsCode","inlineCode":["if(gdjs.microphone.meter) {\r"," eventsFunctionContext.returnValue = gdjs.microphone.meter.volume;\r","}\r",""],"parameterObjects":"","useStrict":true,"eventsSheetExpanded":false}],"expressionType":{"type":"expression"},"parameters":[],"objectGroups":[]}],"eventsBasedBehaviors":[],"eventsBasedObjects":[]},{"author":"Tristan Rhodes (https://victrisgames.itch.io/)","category":"Visual effect","extensionNamespace":"","fullName":"Shake Object (position, angle, scale)","helpPath":"https://victrisgames.itch.io/gdevelop-camera-shake-example","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFycm93LWFsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMywxMUgxOEwxNi41LDkuNUwxNy45Miw4LjA4TDIxLjg0LDEyTDE3LjkyLDE1LjkyTDE2LjUsMTQuNUwxOCwxM0gxM1YxOEwxNC41LDE2LjVMMTUuOTIsMTcuOTJMMTIsMjEuODRMOC4wOCwxNy45Mkw5LjUsMTYuNUwxMSwxOFYxM0g2TDcuNSwxNC41TDYuMDgsMTUuOTJMMi4xNiwxMkw2LjA4LDguMDhMNy41LDkuNUw2LDExSDExVjZMOS41LDcuNUw4LjA4LDYuMDhMMTIsMi4xNkwxNS45Miw2LjA4TDE0LjUsNy41TDEzLDZWMTFaIiAvPjwvc3ZnPg==","name":"ShakeObject","previewIconUrl":"https://resources.gdevelop-app.com/assets/Icons/arrow-all.svg","shortDescription":"Shake an object, using one or more ways to shake (position, angle, scale).","version":"1.5.5","description":["Select one or more methods of shaking:","- Position: Shake the X and/or Y position of the object ","- Angle: Shake the angle (rotation) of the object ","- Scale: Shake the scale of the object (must be a sprite)","","Control how the object shakes:","- Amplitude: How far the object moves during each shake","- Duration: Amount of time to shake the object","- Time between shakes: Amount of time between each movement of the object","- Keep shaking until stopped (boolean)","","Tips:","- For a single-shake effect, set the \"Time between shakes\" to be equal to \"Duration\" (great for a hit or impact)","- To make the single-shake move in the opposite direction, use negative numbers ","- To repeat a single-shake effect in a loop, add a condition \"Object is not shaking\" ","- Use a long \"Time between shakes\" to simulate a slow moving object (like a ship rocking back and forth)","- Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters. ","- Use \"Shake until stopped\" to simulate engine vibration, earthquake, or pulsing"],"origin":{"identifier":"ShakeObject","name":"gdevelop-extension-store"},"tags":["shaking","object","effect","shake","scale","position","rotate","angle"],"authorIds":["gqDaZjCfevOOxBYkK6zlhtZnXCg1"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[{"description":"Shake an object, using one or more ways to shake (position, angle).\nThis behavior can be used on any type of object.","fullName":"Shake object (position, angle)","name":"ShakeObject_PositionAngle","objectType":"","eventsFunctions":[{"description":"Shake an object, using one or more ways to shake (position, angle).","fullName":"Shake object (position, angle)","functionType":"Action","name":"ShakeObject_PositionAngle","sentence":"Shake object _PARAM0_ for _PARAM2_ seconds. Modify position amplitude _PARAM3_ on X axis and _PARAM4_ on Y axis, angle rotation amplitude _PARAM5_. Wait _PARAM6_ seconds between shakes. Keep shaking until stopped: _PARAM7_","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Shake Object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Start/Reset duration timer","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\""]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Pass input parameters to global variables so that onScenePostEvents can use them","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","GetArgumentAsNumber(\"Duration\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerX","=","GetArgumentAsNumber(\"PowerX\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerY","=","GetArgumentAsNumber(\"PowerY\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","=","GetArgumentAsNumber(\"PowerAngle\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","GetArgumentAsNumber(\"TimeBetweenShakes\")"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Determine if the shake should keep going until stopped","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","False"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"GetArgumentAsBoolean"},"parameters":["\"ShakeForever\""]}],"actions":[{"type":{"value":"SetObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","True"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Add default values if none were provided","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_Duration","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","0.5"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","0.08"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"If duration is less than a single shake, increase duration to make 1 full shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_Duration","<","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Detect initial shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Initiate the onScenePostEvents function","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}]}],"parameters":[]}],"parameters":[{"description":"Object","name":"Object","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngle","type":"behavior"},{"description":"Duration of shake (in seconds) (Default: 0.5) ","name":"Duration","type":"expression"},{"description":"Amplitude of postion shake in X direction (in pixels) (For example: 5)","name":"PowerX","type":"expression"},{"description":"Amplitude of position shake in Y direction (in pixels) (For example: 5)","name":"PowerY","type":"expression"},{"description":"Amplitude of angle rotation shake (in degrees) (For example: 5)","name":"PowerAngle","type":"expression"},{"description":"Amount of time between shakes (in seconds) (Default: 0.08)","name":"TimeBetweenShakes","type":"expression"},{"description":"Keep shaking until stopped","longDescription":"Duration value will be ignored","name":"ShakeForever","type":"yesorno"}],"objectGroups":[]},{"fullName":"","functionType":"Action","name":"doStepPostEvents","sentence":"","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Shake Object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Start shaking","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Keep object shaking forever (if desired)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","True"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","100"]},{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\""]}]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Calculate movement of the shake","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Run once before every shake movement","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]},{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}]}],"actions":[{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\""]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeCounter","+","1"]}],"events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Correct for drift and reset drift tracking variables","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Move to correct any drift from previous shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledX)"]},{"type":{"value":"MettreY"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledY)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","Object.Variable(__ShakeObject_AngleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Reset drift detection variables","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","=","0"]}]}],"parameters":[]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate Position Shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Make initial shake NOT random so users can set a direction for a one-shake effect","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementX","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementY","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY)"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"After initial shake pick a random direction","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","0"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementX","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX) * RandomWithStep(-1, 1, 2)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementY","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY) * RandomWithStep(-1, 1, 2)"]}]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate Rotation (angle) shake ","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every \"even\" shake, rotate clockwise","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementAngle","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every \"odd\" shake, rotate counter-clockwise","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","1"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementAngle","=","-1 *(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save that initial shake has been processed","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","0"]}]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Move object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate the fraction of shake that occured during this frame","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PercentTimeElapsedThisFrame","=","min(1,TimeDelta()/Object.Variable(__ShakeObject_TimeBetweenShakes))"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Increase change for the first half of the shake (move away from original values)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)/2"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change position","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"MettreY"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","+","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","+","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change angle","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerAngle)","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","+","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Decrease change the second half of the shake (return to original position)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)/2"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change position","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"MettreY"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","-","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","-","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change angle","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerAngle)","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","-","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]}]}],"parameters":[]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Stop shaking","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Stop shaking when the duration has been reached (or if the stop shaking function was called)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\"","Object.Variable(__ShakeObject_Duration)"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","-1"]}]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeCounter","=","0"]}],"events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Correct for drift and reset drift tracking variables","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Move to correct any drift from previous shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledX)"]},{"type":{"value":"MettreY"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledY)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","Object.Variable(__ShakeObject_AngleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Reset drift detection variables","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","=","0"]}]}],"parameters":[]}]}],"parameters":[]}],"parameters":[]}],"parameters":[{"description":"Object","name":"Object","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngle","type":"behavior"}],"objectGroups":[]},{"description":"Stop any shaking of object that was initiated by the Shake Object extension.","fullName":"Stop shaking the object","functionType":"Action","name":"StopShaking","sentence":"Stop shaking _PARAM0_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ShakeObject::ShakeObject_PositionAngle::IsShaking"},"parameters":["Object","Behavior",""]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","-1"]}]}],"parameters":[{"description":"Object","name":"Object","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngle","type":"behavior"}],"objectGroups":[]},{"description":"Check if an object is shaking.","fullName":"Check if an object is shaking","functionType":"Condition","name":"IsShaking","sentence":"_PARAM0_ is shaking","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Object","name":"Object","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngle","type":"behavior"}],"objectGroups":[]}],"propertyDescriptors":[],"sharedPropertyDescriptors":[]},{"description":"Shake an object, using one or more ways to shake (position, angle, scale)\nThis behavior can only be used on sprite objects.","fullName":"Shake object (position, angle, scale)","name":"ShakeObject_PositionAngleScale","objectType":"Sprite","eventsFunctions":[{"description":"Shake an object, using one or more ways to shake (position, angle, scale).","fullName":"Shake object (position, angle, scale)","functionType":"Action","name":"ShakeObject_PositionAngleScale","sentence":"Shake object _PARAM0_ for _PARAM2_ seconds. Modify position amplitude _PARAM3_ on X axis and _PARAM4_ on Y axis, angle rotation amplitude _PARAM5_, and scale amplitude _PARAM6_. Wait _PARAM7_ seconds between shakes. Keep shaking until stopped: _PARAM8_","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Shake Object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Start/Reset duration timer","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\""]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Pass input parameters to global variables so that onScenePostEvents can use them","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","GetArgumentAsNumber(\"Duration\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerX","=","GetArgumentAsNumber(\"PowerX\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerY","=","GetArgumentAsNumber(\"PowerY\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","=","GetArgumentAsNumber(\"PowerAngle\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PowerScale","=","GetArgumentAsNumber(\"PowerScale\")"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","GetArgumentAsNumber(\"TimeBetweenShakes\")"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Determine if the shake should keep going until stopped","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","False"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"GetArgumentAsBoolean"},"parameters":["\"ShakeForever\""]}],"actions":[{"type":{"value":"SetObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","True"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Add default values if none were provided","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_Duration","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","0.5"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_TimeBetweenShakes","=","0.08"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"If duration is less than a single shake, increase duration to make 1 full shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_Duration","<","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Detect initial shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Initiate the onScenePostEvents function","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}]}],"parameters":[]}],"parameters":[{"description":"Object","name":"Object","supplementaryInformation":"Sprite","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngleScale","type":"behavior"},{"description":"Duration of shake (in seconds) (Default: 0.5)","name":"Duration","type":"expression"},{"description":"Amplitude of postion shake in X direction (in pixels) (For example: 5)","name":"PowerX","type":"expression"},{"description":"Amplitude of position shake in Y direction (in pixels) (For example: 5)","name":"PowerY","type":"expression"},{"description":"Amplitude of angle rotation shake (in degrees) (For example: 5)","name":"PowerAngle","type":"expression"},{"description":"Amplitude of scale shake (in percent change) (For example: 5)","name":"PowerScale","type":"expression"},{"description":"Amount of time between shakes (in seconds) (Default: 0.08)","name":"TimeBetweenShakes","type":"expression"},{"description":"Keep shaking until stopped","longDescription":"Duration value will be ignored","name":"ShakeForever","type":"yesorno"}],"objectGroups":[]},{"fullName":"","functionType":"Action","name":"doStepPostEvents","sentence":"","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Shake Object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Start shaking","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Keep object shaking forever (if desired)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ObjectVariableAsBoolean"},"parameters":["Object","__ShakeObject_ShakeForever","True"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_Duration","=","100"]},{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\""]}]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Calculate movement of the shake","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Run once before every shake movement","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]},{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)"]}]}],"actions":[{"type":{"value":"ResetObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\""]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeCounter","+","1"]}],"events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"folded":true,"name":"Correct for drift and reset drift tracking variables","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Move to correct any drift from previous shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledX)"]},{"type":{"value":"MettreY"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledY)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","Object.Variable(__ShakeObject_AngleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerScale","!=","0"]}],"actions":[{"type":{"value":"ChangeScale"},"parameters":["Object","-","Object.Variable(__ShakeObject_ScaleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Reset drift detection variables","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ScaleTravelled","=","0"]}]}],"parameters":[]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate Position Shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Make initial shake NOT random so users can set a direction for a one-shake effect","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","1"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementX","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementY","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY)"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"After initial shake pick a random direction","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","0"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementX","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX) * RandomWithStep(-1, 1, 2)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementY","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY) * RandomWithStep(-1, 1, 2)"]}]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate Rotation (angle) shake ","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every \"even\" shake, rotate clockwise","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementAngle","=","-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every \"odd\" shake, rotate counter-clockwise","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","1"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementAngle","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate Scale shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerScale","!=","0"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate object scale displacement, with linear decay over time","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"ScaleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every even shake, increase scale","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","0"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementScale","=","-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Every \"odd\" shake, decrease scale","comment2":""},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"ScaleDisplacement = -1 * (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["mod(Object.Variable(__ShakeObject_ShakeCounter),2)","=","1"]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementScale","=","(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save that initial shake has been processed","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_InitialShake","=","0"]}]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Move object","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Calculate the fraction of shake that occured during this frame","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_PercentTimeElapsedThisFrame","=","min(1,TimeDelta()/Object.Variable(__ShakeObject_TimeBetweenShakes))"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Increase change for the first half of the shake (move away from original values)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"inverted":true,"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)/2"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change position","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"MettreY"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","+","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","+","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change angle","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerAngle)","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","+","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change scale","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerScale)","!=","0"]}],"actions":[{"type":{"value":"ChangeScale"},"parameters":["Object","+","round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ScaleTravelled","+","round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Decrease change the second half of the shake (return to original position)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_ShakeTimer\"","Object.Variable(__ShakeObject_TimeBetweenShakes)/2"]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change position","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"MettreY"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","-","round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","-","round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change angle","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerAngle)","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","-","round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Change scale","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"Egal"},"parameters":["Object.Variable(__ShakeObject_PowerScale)","!=","0"]}],"actions":[{"type":{"value":"ChangeScale"},"parameters":["Object","-","round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}],"events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Save movement to calculate drift","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ScaleTravelled","-","round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024"]}]}]}]}],"parameters":[]}]}],"parameters":[]},{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Stop shaking","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Stop shaking when the duration has been reached (or if the stop shaking function was called)","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"ObjectTimer"},"parameters":["Object","\"__ShakeObject_DurationTimer\"","Object.Variable(__ShakeObject_Duration)"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","-1"]}]},{"type":{"value":"BuiltinCommonInstructions::Once"},"parameters":[]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeCounter","=","0"]}],"events":[{"colorB":228,"colorG":176,"colorR":74,"creationTime":0,"name":"Correct for drift and reset drift tracking variables","source":"","type":"BuiltinCommonInstructions::Group","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Move to correct any drift from previous shake","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::Or"},"parameters":[],"subInstructions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerX","!=","0"]},{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerY","!=","0"]}]}],"actions":[{"type":{"value":"MettreX"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledX)"]},{"type":{"value":"MettreY"},"parameters":["Object","-","Object.Variable(__ShakeObject_DisplacementTravelledY)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerAngle","!=","0"]}],"actions":[{"type":{"value":"SetAngle"},"parameters":["Object","-","Object.Variable(__ShakeObject_AngleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_PowerScale","!=","0"]}],"actions":[{"type":{"value":"ChangeScale"},"parameters":["Object","-","Object.Variable(__ShakeObject_ScaleTravelled)"]}]},{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Reset drift detection variables","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledX","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_DisplacementTravelledY","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_AngleTravelled","=","0"]},{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ScaleTravelled","=","0"]}]}],"parameters":[]}]}],"parameters":[]}],"parameters":[]}],"parameters":[{"description":"Object","name":"Object","supplementaryInformation":"Sprite","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngleScale","type":"behavior"}],"objectGroups":[]},{"description":"Stop shaking an object.","fullName":"Stop shaking an object","functionType":"Action","name":"StopShaking","sentence":"Stop shaking _PARAM0_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"ShakeObject::ShakeObject_PositionAngleScale::IsShaking"},"parameters":["Object","Behavior",""]}],"actions":[{"type":{"value":"ModVarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","-1"]}]}],"parameters":[{"description":"Object","name":"Object","supplementaryInformation":"Sprite","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngleScale","type":"behavior"}],"objectGroups":[]},{"description":"Check if an object is shaking.","fullName":"Check if an object is shaking","functionType":"Condition","name":"IsShaking","sentence":"_PARAM0_ is shaking","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarObjet"},"parameters":["Object","__ShakeObject_ShakeInProgress","=","1"]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Object","name":"Object","supplementaryInformation":"Sprite","type":"object"},{"description":"Behavior","name":"Behavior","supplementaryInformation":"ShakeObject::ShakeObject_PositionAngleScale","type":"behavior"}],"objectGroups":[]}],"propertyDescriptors":[],"sharedPropertyDescriptors":[]}],"eventsBasedObjects":[]}],"externalLayouts":[],"externalSourceFiles":[]}