Skip to content

Instantly share code, notes, and snippets.

@paulera
Last active June 21, 2020 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulera/900c297128f1bf0f6e5326ec30fe3805 to your computer and use it in GitHub Desktop.
Save paulera/900c297128f1bf0f6e5326ec30fe3805 to your computer and use it in GitHub Desktop.
Example of how to implement a board game of arbitrary shape in GDevelop 5, based on tiles placement. See more: https://paulera.itch.io/board-walk-with-raycast
{
"firstLayout": "",
"gdVersion": {
"build": 98,
"major": 4,
"minor": 0,
"revision": 0
},
"properties": {
"adMobAppId": "",
"adaptGameResolutionAtRuntime": true,
"folderProject": false,
"linuxExecutableFilename": "",
"macExecutableFilename": "",
"orientation": "landscape",
"packageName": "com.unforgivenexception.gdevelop.boardwalkwithraycast",
"projectFile": "board-walk-with-raycast.json",
"scaleMode": "linear",
"sizeOnStartupMode": "adaptWidth",
"useExternalSourceFiles": false,
"version": "1.0.0",
"winExecutableFilename": "",
"winExecutableIconFile": "",
"name": "Board walk with Raycast",
"author": "Paulo Amaral",
"windowWidth": 800,
"windowHeight": 600,
"latestCompilationDirectory": "",
"maxFPS": 60,
"minFPS": 20,
"verticalSync": false,
"platformSpecificAssets": {},
"loadingScreen": {
"showGDevelopSplash": true
},
"extensions": [
{
"name": "BuiltinObject"
},
{
"name": "BuiltinAudio"
},
{
"name": "BuiltinVariables"
},
{
"name": "BuiltinTime"
},
{
"name": "BuiltinMouse"
},
{
"name": "BuiltinKeyboard"
},
{
"name": "BuiltinJoystick"
},
{
"name": "BuiltinCamera"
},
{
"name": "BuiltinWindow"
},
{
"name": "BuiltinFile"
},
{
"name": "BuiltinNetwork"
},
{
"name": "BuiltinScene"
},
{
"name": "BuiltinAdvanced"
},
{
"name": "Sprite"
},
{
"name": "BuiltinCommonInstructions"
},
{
"name": "BuiltinCommonConversions"
},
{
"name": "BuiltinStringInstructions"
},
{
"name": "BuiltinMathematicalTools"
},
{
"name": "BuiltinExternalLayouts"
}
],
"platforms": [
{
"name": "GDevelop JS platform"
}
],
"currentPlatform": "GDevelop JS platform"
},
"resources": {
"resources": [
{
"alwaysLoaded": false,
"file": "https://resources.gdevelop-app.com/examples/platformer/p1_stand.png",
"kind": "image",
"metadata": "",
"name": "https://resources.gdevelop-app.com/examples/platformer/p1_stand.png",
"smoothed": true,
"userAdded": true
},
{
"alwaysLoaded": false,
"file": "https://resources.gdevelop-app.com/examples/platformer/brickWall.png",
"kind": "image",
"metadata": "",
"name": "https://resources.gdevelop-app.com/examples/platformer/brickWall.png",
"smoothed": true,
"userAdded": true
}
],
"resourceFolders": []
},
"objects": [],
"objectsGroups": [],
"variables": [],
"layouts": [
{
"b": 209,
"disableInputWhenNotFocused": true,
"mangledName": "New_32scene",
"name": "New scene",
"oglFOV": 90,
"oglZFar": 500,
"oglZNear": 1,
"r": 209,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 209,
"uiSettings": {
"grid": false,
"gridB": 255,
"gridG": 180,
"gridHeight": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridR": 158,
"gridWidth": 32,
"snap": true,
"windowMask": false,
"zoomFactor": 0.556
},
"objectsGroups": [],
"variables": [],
"instances": [
{
"angle": 0,
"customSize": true,
"height": 60,
"layer": "",
"locked": false,
"name": "Player",
"width": 47,
"x": 70,
"y": 55,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 73,
"y": 53,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 154,
"y": 53,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 233,
"y": 60,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 313,
"y": 57,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 394,
"y": 62,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 471,
"y": 59,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 551,
"y": 64,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 632,
"y": 66,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 712,
"y": 69,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 712,
"y": 149,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 713,
"y": 227,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 635,
"y": 229,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 556,
"y": 232,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 555,
"y": 309,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 480,
"y": 232,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 402,
"y": 234,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 555,
"y": 386,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 553,
"y": 458,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 630,
"y": 458,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 707,
"y": 457,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 478,
"y": 384,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 403,
"y": 383,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 403,
"y": 311,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 480,
"y": 313,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 327,
"y": 310,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 250,
"y": 312,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 173,
"y": 310,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 175,
"y": 389,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 97,
"y": 313,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 96,
"y": 388,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 92,
"y": 464,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 172,
"y": 466,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 251,
"y": 464,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 249,
"y": 547,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 168,
"y": 547,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Block",
"width": 0,
"x": 90,
"y": 549,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "ObjVariableBlockUp",
"width": 0,
"x": -2,
"y": -148,
"zOrder": 38,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "ObjVariableBlockDown",
"width": 0,
"x": -3,
"y": -119,
"zOrder": 39,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "ObjVariableBlockLeft",
"width": 0,
"x": -2,
"y": -89,
"zOrder": 40,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "ObjVariableBlockRight",
"width": 0,
"x": 0,
"y": -59,
"zOrder": 41,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "Info",
"width": 0,
"x": 44,
"y": 115,
"zOrder": 43,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"name": "Player",
"tags": "",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [],
"behaviors": [],
"animations": [
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "https://resources.gdevelop-app.com/examples/platformer/p1_stand.png",
"points": [],
"originPoint": {
"name": "origine",
"x": 36,
"y": 50
},
"centerPoint": {
"automatic": false,
"name": "centre",
"x": 36,
"y": 50
},
"customCollisionMask": []
}
]
}
]
}
]
},
{
"name": "Block",
"tags": "",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [],
"behaviors": [
{
"name": "Draggable",
"type": "DraggableBehavior::Draggable"
}
],
"animations": [
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "https://resources.gdevelop-app.com/examples/platformer/brickWall.png",
"points": [],
"originPoint": {
"name": "origine",
"x": 37.457,
"y": 35.082
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": []
}
]
}
]
}
]
},
{
"bold": false,
"italic": false,
"name": "ObjVariableBlockUp",
"smoothed": true,
"tags": "",
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"behaviors": [],
"string": "ObjVariableBlockUp",
"font": "",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
}
},
{
"bold": false,
"italic": false,
"name": "ObjVariableBlockDown",
"smoothed": true,
"tags": "",
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"behaviors": [],
"string": "ObjVariableBlockDown",
"font": "",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
}
},
{
"bold": false,
"italic": false,
"name": "ObjVariableBlockLeft",
"smoothed": true,
"tags": "",
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"behaviors": [],
"string": "ObjVariableBlockLeft",
"font": "",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
}
},
{
"bold": false,
"italic": false,
"name": "ObjVariableBlockRight",
"smoothed": true,
"tags": "",
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"behaviors": [],
"string": "ObjVariableBlockRight",
"font": "",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
}
},
{
"bold": false,
"italic": false,
"name": "Info",
"smoothed": true,
"tags": "",
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"behaviors": [],
"string": "Use the arrow keys or WSAD to move around the board. The possible moves are\ndetected in realtime using the Raycast condition. Blocks have Draggable\nbehaviour, so you can move them to modify the level during the gameplay.",
"font": "",
"characterSize": 15,
"color": {
"b": 0,
"g": 0,
"r": 0
}
}
],
"events": [
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "WALKING AN ARBITRARY BOARD\n\nThis example shows how to make the player walk through a board of tiles using the arrow keys. Steps will move the player to the centre of the next tile, as in traditional board games.\nThe tiles don't need to be perfectly aligned nor spaced.\n",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "The text objects named \"ObjVariableBlock...\" are used to store a reference to the blocks where the player can move to. Think of them like variables that can store objects, instead of just text or number. We clean them up every frame before detecting the possible directions of movement.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "DepartScene"
},
"parameters": [
""
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "Cache"
},
"parameters": [
"ObjVariableBlockUp"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Cache"
},
"parameters": [
"ObjVariableBlockDown"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Cache"
},
"parameters": [
"ObjVariableBlockLeft"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Cache"
},
"parameters": [
"ObjVariableBlockRight"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"inverted": false,
"value": "Opacity"
},
"parameters": [
"Block",
"=",
"100"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::RemoveAllLinksOf"
},
"parameters": [
"",
"ObjVariableBlockUp"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::RemoveAllLinksOf"
},
"parameters": [
"",
"ObjVariableBlockDown"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::RemoveAllLinksOf"
},
"parameters": [
"",
"ObjVariableBlockLeft"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::RemoveAllLinksOf"
},
"parameters": [
"",
"ObjVariableBlockRight"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "The Raycast condition will shot an invisible ray from the Player origin point (X,Y), at a specific angle, detecting Block objects it hits.\n\nRight = 0 degrees\nDown = 90 degrees\nLeft = 180 degrees\nUp = 270 degrees\n\nThe \"Ray Maximum Distance\" it will travel is the size of 1 block (double click the condition to view this option, as well as the angle).\nThe condition is inverted to detect the farthest Block within \"Ray Maximum Distance\" pixels (not the closest).\nThere are 4 rays, one for each direction (Up, Down, Left and Right).\n\nThe blocks detected by the Raycasts will have opacity restored to show which ones they are.\n\n* When the player can't move in a particular direction, the block detected by the ray of that direction will be the current one where the player is. The inverted collision condition together with each Raycast solves this issue.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "The Block detected by each Raycast will be linked to each Text object \"ObjVariableBlock...\" so they can be used for movement later.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "Raycast"
},
"parameters": [
"Block",
"Player.X()",
"Player.Y()",
"270",
"Block.Height()",
"",
"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": true,
"value": "CollisionNP"
},
"parameters": [
"Block",
"Player",
"",
"",
""
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "LinkedObjects::LinkObjects"
},
"parameters": [
"",
"Block",
"ObjVariableBlockUp"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Opacity"
},
"parameters": [
"Block",
"=",
"250"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "Raycast"
},
"parameters": [
"Block",
"Player.X()",
"Player.Y()",
"90",
"Block.Height()",
"",
"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": true,
"value": "CollisionNP"
},
"parameters": [
"Block",
"Player",
"",
"",
""
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "LinkedObjects::LinkObjects"
},
"parameters": [
"",
"Block",
"ObjVariableBlockDown"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Opacity"
},
"parameters": [
"Block",
"=",
"250"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "Raycast"
},
"parameters": [
"Block",
"Player.X()",
"Player.Y()",
"180",
"Block.Width()",
"",
"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": true,
"value": "CollisionNP"
},
"parameters": [
"Block",
"Player",
"",
"",
""
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "LinkedObjects::LinkObjects"
},
"parameters": [
"",
"Block",
"ObjVariableBlockLeft"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Opacity"
},
"parameters": [
"Block",
"=",
"250"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "Raycast"
},
"parameters": [
"Block",
"Player.X()",
"Player.Y()",
"0",
"Block.Width()",
"",
"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": true,
"value": "CollisionNP"
},
"parameters": [
"Block",
"Player",
"",
"",
""
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "LinkedObjects::LinkObjects"
},
"parameters": [
"",
"Block",
"ObjVariableBlockRight"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "Opacity"
},
"parameters": [
"Block",
"=",
"250"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "When a key is pressed, check what is the Block the Player can move to (it was linked by the Raycast to the Text object with name \"ObjVariableBlock...\") and move the Player to it.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Right"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"d"
],
"subInstructions": []
}
]
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::PickObjectsLinkedTo"
},
"parameters": [
"",
"Block",
"ObjVariableBlockRight"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Once"
},
"parameters": [],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "MettreXY"
},
"parameters": [
"Player",
"=",
"Block.X()",
"=",
"Block.Y()"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Up"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"w"
],
"subInstructions": []
}
]
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::PickObjectsLinkedTo"
},
"parameters": [
"",
"Block",
"ObjVariableBlockUp"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Once"
},
"parameters": [],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "MettreXY"
},
"parameters": [
"Player",
"=",
"Block.X()",
"=",
"Block.Y()"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Down"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"s"
],
"subInstructions": []
}
]
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::PickObjectsLinkedTo"
},
"parameters": [
"",
"Block",
"ObjVariableBlockDown"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Once"
},
"parameters": [],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "MettreXY"
},
"parameters": [
"Player",
"=",
"Block.X()",
"=",
"Block.Y()"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Left"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"a"
],
"subInstructions": []
}
]
},
{
"type": {
"inverted": false,
"value": "LinkedObjects::PickObjectsLinkedTo"
},
"parameters": [
"",
"Block",
"ObjVariableBlockLeft"
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "BuiltinCommonInstructions::Once"
},
"parameters": [],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "MettreXY"
},
"parameters": [
"Player",
"=",
"Block.X()",
"=",
"Block.Y()"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "When the loop will run again, all links will be discarded, re-detected and re-linked.",
"comment2": ""
}
],
"layers": [
{
"name": "",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
}
],
"behaviorsSharedData": []
}
],
"externalEvents": [],
"eventsFunctionsExtensions": [],
"externalLayouts": [],
"externalSourceFiles": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment