Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Placed city 2 in external event (WIP)
Repositioned walls
Added effects to mask the blurry sprites
Creates Sea when you are close to it and deletes it when you are far from it. (Might revert to old system)
Rename "Niko" to "player"
Fixed the basket ball court
Added some documentation.
  • Loading branch information
TheGemDev committed Apr 19, 2024
1 parent 5c31649 commit 79c34ba
Show file tree
Hide file tree
Showing 24 changed files with 159,390 additions and 179 deletions.
5 changes: 0 additions & 5 deletions src/eventsFunctionsExtensions/button.json
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "ANIMATION_UP"
},
{
Expand All @@ -970,7 +969,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "ANIMATION_OVER"
},
{
Expand All @@ -980,7 +978,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "ANIMATION_DOWN"
},
{
Expand All @@ -990,7 +987,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "ANIMATION_DISABLED"
},
{
Expand All @@ -1000,7 +996,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "ENABLED"
}
],
Expand Down
129 changes: 129 additions & 0 deletions src/eventsFunctionsExtensions/isonscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"author": "Silver-Streak, @Bouh, Tristan Rhodes",
"category": "Game mechanic",
"extensionNamespace": "",
"fullName": "Object \"Is On Screen\" Detection",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=",
"name": "IsOnScreen",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg",
"shortDescription": "This adds a condition to detect if an object is on screen based off its current layer.",
"version": "1.2.1",
"description": [
"This extension adds conditions to check if an object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.",
"",
"Note that this does not take into account any object visibility, such as being hidden or 0 opacity, but can be combined with those existing conditions."
],
"origin": {
"identifier": "IsOnScreen",
"name": "gdevelop-extension-store"
},
"tags": [
"is on screen",
"condition",
"visible",
"hide",
"screen"
],
"authorIds": [
"2OwwM8ToR9dx9RJ2sAKTcrLmCB92",
"8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3",
"gqDaZjCfevOOxBYkK6zlhtZnXCg1"
],
"dependencies": [],
"eventsFunctions": [],
"eventsBasedBehaviors": [
{
"description": "This behavior provides a condition to check if the object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.\nNote that object visibility, such as being hidden or 0 opacity, is not considered (but you can use those existing conditions in addition to this behavior).",
"fullName": "Is on screen",
"name": "InOnScreen",
"objectType": "",
"eventsFunctions": [
{
"description": "Checks if an object position is within the viewport of its layer.",
"fullName": "Is on screen",
"functionType": "Condition",
"name": "IsOnScreen",
"sentence": "_PARAM0_ is on screen (padded by _PARAM2_ pixels)",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/*",
"Get the object layer, convert the position from this layer to the screen coordinates.",
"Get the point on each side on the object on screen, and compare with the screen area.",
"",
"This way even if the camera has a rotation or custom scale the object is always compared to the screen area.",
"*/",
"",
"",
"// Get the layer of the object.",
"const object = objects[0];",
"const layer = runtimeScene.getLayer(object.getLayer());",
"",
"// Get the aabb of the object on his layer.",
"const aabb = object.getVisibilityAABB();",
"",
"// Get the layer to convert the coordinates of the AABB to the screen coordinates",
"const topLeft = layer.convertInverseCoords(aabb.min[0], aabb.min[1]);",
"const topRight = layer.convertInverseCoords(aabb.max[0], aabb.min[1]);",
"const bottomRight = layer.convertInverseCoords(aabb.max[0], aabb.max[1]);",
"const bottomLeft = layer.convertInverseCoords(aabb.min[0], aabb.max[1]);",
"",
"// Get the points on each side of the object on screen.",
"const posLeftObjectOnScreen = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);",
"const posRightObjectOnScreen = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);",
"const posUpObjectOnScreen = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);",
"const posDownObjectOnScreen = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);",
"",
"const padding = eventsFunctionContext.getArgument(\"Padding\");",
"",
"if (",
" !(posLeftObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionWidth() ||",
" posUpObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionHeight() ||",
" posRightObjectOnScreen + padding < 0 ||",
" posDownObjectOnScreen + padding < 0",
" )",
") {",
" eventsFunctionContext.returnValue = true;",
"}",
""
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "IsOnScreen::InOnScreen",
"type": "behavior"
},
{
"description": "Padding (in pixels)",
"longDescription": "Number of pixels to pad the screen border. Zero by default. A negative value goes inside the screen, a positive value go outside.",
"name": "Padding",
"type": "expression"
}
],
"objectGroups": [
{
"name": "Group",
"objects": []
}
]
}
],
"propertyDescriptors": [],
"sharedPropertyDescriptors": []
}
],
"eventsBasedObjects": []
}
32 changes: 20 additions & 12 deletions src/eventsFunctionsExtensions/panelspritecontinuousbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "Value"
},
{
Expand All @@ -661,7 +660,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "MaxValue"
},
{
Expand All @@ -681,7 +679,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "PreviousHighValueDuration"
}
],
Expand Down Expand Up @@ -2266,7 +2263,6 @@
"FillBar",
"Buffer"
],
"hidden": false,
"name": "BarLeftPadding"
},
{
Expand All @@ -2280,7 +2276,6 @@
"FillBar",
"Buffer"
],
"hidden": false,
"name": "BarTopPadding"
},
{
Expand All @@ -2294,7 +2289,6 @@
"FillBar",
"Buffer"
],
"hidden": false,
"name": "BarRightPadding"
},
{
Expand All @@ -2308,7 +2302,6 @@
"FillBar",
"Buffer"
],
"hidden": false,
"name": "BarBottomPadding"
},
{
Expand All @@ -2318,7 +2311,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "MaxValue"
},
{
Expand All @@ -2328,7 +2320,6 @@
"description": "",
"group": "",
"extraInformation": [],
"hidden": false,
"name": "InitialValue"
},
{
Expand All @@ -2348,7 +2339,6 @@
"description": "",
"group": "Animation",
"extraInformation": [],
"hidden": false,
"name": "PreviousHighValueDuration"
},
{
Expand All @@ -2358,7 +2348,6 @@
"description": "",
"group": "Animation",
"extraInformation": [],
"hidden": false,
"name": "EasingDuration"
},
{
Expand All @@ -2370,7 +2359,6 @@
"extraInformation": [
"Label"
],
"hidden": false,
"name": "ShowLabel"
},
{
Expand Down Expand Up @@ -2430,6 +2418,26 @@
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "2 / 3",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": "0;0;0"
}
},
{
Expand Down
Loading

0 comments on commit 79c34ba

Please sign in to comment.