Compare commits

...

17 Commits

Author SHA1 Message Date
Florian Rival
0a35bc3272 Bump newIDE version 2018-01-22 23:35:55 +01:00
Florian Rival
d8b737a31f Fix LocalS3Export always reusing the same folder leading to useless files in exported game 2018-01-22 23:35:32 +01:00
Florian Rival
cfd2655f6c Bump newIDE version 2018-01-22 23:29:21 +01:00
Florian Rival
1896241b9d Move AWS S3 credentials to an .env file for games deployment on GDevelop hosting 2018-01-22 23:25:42 +01:00
Florian Rival
0ed22a6ee1 Fix upload to GDevelop hosting of exported games with large files 2018-01-22 22:52:44 +01:00
Florian Rival
2bfcb99c3e Add analytics when a signup is done 2018-01-22 00:20:32 +01:00
Florian Rival
815f8a520a Bump newIDE version 2018-01-21 22:11:59 +01:00
Florian Rival
f115b6607f Add PhysicsBehavior support to newIDE, with an example 2018-01-21 22:11:24 +01:00
Florian Rival
c876f67502 Add pathfinding example to newIDE web-app 2018-01-20 21:25:25 +01:00
Florian Rival
27674f272c Bump newIDE version 2018-01-20 19:21:13 +01:00
Florian Rival
02879507e3 Fix tests (outdated snapshots after adding Pathfinding to newIDE) 2018-01-20 19:19:38 +01:00
Florian Rival
0a7629878f Fix Sepia layer effect (broken since Pixi v4 update) 2018-01-20 19:00:22 +01:00
Florian Rival
b0368232d0 Add Parallax example to newIDE 2018-01-20 17:19:45 +01:00
Florian Rival
a32bf3db98 Add Pathfinding and Zombie Laser examples to newIDE 2018-01-20 17:02:47 +01:00
Florian Rival
64cbbb20d3 Expose PathfindingBehavior when building with Emscripten 2018-01-20 16:53:12 +01:00
Florian Rival
dd4fbecc98 Update some GDevelop services API to use api.gdevelop-app.com 2018-01-20 16:28:27 +01:00
Florian Rival
807a75a265 Update productName for newIDE 2018-01-19 00:24:07 +01:00
87 changed files with 13839 additions and 1345 deletions

View File

@@ -13,6 +13,7 @@
"/usr/local/lib/wx/include/osx_cocoa-unicode-3.0",
"/usr/local/include/wx-3.0",
"/usr/include/machine",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include",
@@ -86,4 +87,4 @@
}
],
"version": 3
}
}

View File

@@ -67,7 +67,10 @@
"__functional_base": "cpp",
"__functional_base_03": "cpp",
"chrono": "cpp",
"ratio": "cpp"
"ratio": "cpp",
"atomic": "cpp",
"locale": "cpp",
"string_view": "cpp"
},
"files.exclude": {
"Binaries/*build*": true,

View File

@@ -10,7 +10,7 @@ include(CMakeUtils.txt) #Functions to factor common tasks done in CMakeLists.txt
#Add all the CMakeLists:
ADD_SUBDIRECTORY(AdMobObject)
ADD_SUBDIRECTORY(AnchorBehavior)
IF (NOT EMSCRIPTEN) #Only add some extensions when compiling with emscripten.
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(AdvancedXML)
ADD_SUBDIRECTORY(AES)
ADD_SUBDIRECTORY(Box3DObject)
@@ -35,9 +35,9 @@ ENDIF()
ADD_SUBDIRECTORY(PanelSpriteObject)
IF (NOT EMSCRIPTEN)
ADD_SUBDIRECTORY(PathBehavior)
ADD_SUBDIRECTORY(PathfindingBehavior)
ADD_SUBDIRECTORY(PhysicsBehavior)
ENDIF()
ADD_SUBDIRECTORY(PathfindingBehavior)
ADD_SUBDIRECTORY(PhysicsBehavior)
ADD_SUBDIRECTORY(PlatformBehavior)
ADD_SUBDIRECTORY(PrimitiveDrawing)
ADD_SUBDIRECTORY(Shopify)

View File

@@ -7,8 +7,6 @@ This project is released under the MIT License.
#if defined(GD_IDE_ONLY)
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Tools/Localization.h"
#include <iostream>
void DeclarePanelSpriteObjectExtension(gd::PlatformExtension & extension);

File diff suppressed because it is too large Load Diff

View File

@@ -8,26 +8,21 @@ This project is released under the MIT License.
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/Tools/Localization.h"
#include <iostream>
void DeclarePathfindingBehaviorExtension(gd::PlatformExtension & extension);
/**
* \brief This class declares information about the JS extension.
*/
class JsExtension : public gd::PlatformExtension
class PathfindingBehaviorJsExtension : public gd::PlatformExtension
{
public:
/**
* \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
JsExtension()
PathfindingBehaviorJsExtension()
{
SetExtensionInformation("PathfindingBehavior",
_("Pathfinding behavior"),
_("Compute paths for objects avoiding obstacles."),
"Florian Rival",
"Open source (MIT License)");
CloneExtension("GDevelop C++ platform", "PathfindingBehavior");
DeclarePathfindingBehaviorExtension(*this);
GetBehaviorMetadata("PathfindingBehavior::PathfindingBehavior")
.SetIncludeFile("Extensions/PathfindingBehavior/pathfindingruntimebehavior.js")
@@ -103,14 +98,21 @@ public:
}
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension * CreateGDJSPathfindingBehaviorExtension() {
return new PathfindingBehaviorJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
return new JsExtension;
return new PathfindingBehaviorJsExtension;
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -6,29 +6,23 @@ This project is released under the MIT License.
*/
#if defined(GD_IDE_ONLY)
#include "GDCore/Extensions/PlatformExtension.h"
#include <iostream>
#include "GDCore/Tools/Localization.h"
void DeclarePhysicsBehaviorExtension(gd::PlatformExtension & extension);
/**
* \brief This class declares information about the JS extension.
*/
class JsExtension : public gd::PlatformExtension
class PhysicsBehaviorJsExtension : public gd::PlatformExtension
{
public:
/**
* \brief Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
JsExtension()
PhysicsBehaviorJsExtension()
{
SetExtensionInformation("PhysicsBehavior",
_("Physics behavior"),
_("Behavior allowing to move objects as if they were subject to the laws of physics."),
"Florian Rival",
"Open source (MIT License)");
CloneExtension("GDevelop C++ platform", "PhysicsBehavior");
DeclarePhysicsBehaviorExtension(*this);
GetBehaviorMetadata("PhysicsBehavior::PhysicsBehavior")
.SetIncludeFile("Extensions/PhysicsBehavior/box2djs/box2d.js")
@@ -145,14 +139,21 @@ public:
*/
StripUnimplementedInstructionsAndExpressions();
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension * CreateGDJSPhysicsBehaviorExtension() {
return new PhysicsBehaviorJsExtension;
}
#else
/**
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" gd::PlatformExtension * GD_EXTENSION_API CreateGDJSExtension() {
return new JsExtension;
return new PhysicsBehaviorJsExtension;
}
#endif
#endif

View File

@@ -7,6 +7,7 @@ This project is released under the MIT License.
#include "PhysicsBehavior.h"
#include <string>
#include "GDCore/Tools/Localization.h"
#include "Box2D/Box2D.h"
#include "Triangulation/triangulate.h"
#include "GDCpp/Runtime/RuntimeScene.h"
@@ -17,6 +18,10 @@ This project is released under the MIT License.
#include "GDCpp/Runtime/Project/Project.h"
#include "GDCpp/Runtime/Project/Layout.h"
#include "RuntimeScenePhysicsDatas.h"
#if defined(GD_IDE_ONLY)
#include <map>
#include "GDCore/IDE/Dialogs/PropertyDescriptor.h"
#endif
#undef GetObject
@@ -100,10 +105,6 @@ void PhysicsBehavior::DoStepPostEvents(RuntimeScene & scene)
float newHeight = object->GetHeight();
if ( (int)objectOldWidth != (int)newWidth || (int)objectOldHeight != (int)newHeight )
{
/*std::cout << "Changed:" << (int)objectOldWidth << "!=" << (int)newWidth << std::endl;
std::cout << "Changed:" << (int)objectOldHeight << "!=" << (int)newHeight << std::endl;
std::cout << "( Object name:" << object->GetName() << std::endl;*/
double oldAngularVelocity = body->GetAngularVelocity();
b2Vec2 oldVelocity = body->GetLinearVelocity();
@@ -700,6 +701,76 @@ void PhysicsBehavior::UnserializeFrom(const gd::SerializerElement & element)
SetPolygonCoords(PhysicsBehavior::GetCoordsVectorFromString(coordsStr, '/', ';'));
}
#if defined(GD_IDE_ONLY)
std::map<gd::String, gd::PropertyDescriptor> PhysicsBehavior::GetProperties(gd::Project & project) const
{
std::map<gd::String, gd::PropertyDescriptor> properties;
gd::String shapeTypeStr = _("Box (rectangle)");
if (shapeType == Box) shapeTypeStr = _("Box (rectangle)");
else if (shapeType == Circle) shapeTypeStr = _("Circle");
else if (shapeType == CustomPolygon) shapeTypeStr = _("Custom polygon");
properties[_("Shape")]
.SetValue(shapeTypeStr)
.SetType("Choice")
.AddExtraInfo(_("Box (rectangle)"))
.AddExtraInfo(_("Circle"));
properties[_("Dynamic object")].SetValue(dynamic ? "true" : "false").SetType("Boolean");
properties[_("Fixed rotation")].SetValue(fixedRotation ? "true" : "false").SetType("Boolean");
properties[_("Consider as bullet (better collision handling)")].SetValue(isBullet ? "true" : "false").SetType("Boolean");
properties[_("Mass density")].SetValue(gd::String::From(massDensity));
properties[_("Friction")].SetValue(gd::String::From(averageFriction));
properties[_("Restitution (elasticity)")].SetValue(gd::String::From(averageRestitution));
properties[_("Linear Damping")].SetValue(gd::String::From(linearDamping));
properties[_("Angular Damping")].SetValue(gd::String::From(angularDamping));
properties[_("PLEASE_ALSO_SHOW_EDIT_BUTTON_THANKS")].SetValue("");
return properties;
}
bool PhysicsBehavior::UpdateProperty(const gd::String & name, const gd::String & value, gd::Project & project)
{
if (name == _("Shape"))
{
if (value == _("Box (rectangle)"))
shapeType = Box;
else if (value == _("Circle"))
shapeType = Circle;
else if (value == _("Custom polygon"))
shapeType = CustomPolygon;
}
if ( name == _("Dynamic object") ) {
dynamic = (value != "0");
}
if ( name == _("Fixed rotation") ) {
fixedRotation = (value != "0");
}
if ( name == _("Consider as bullet (better collision handling)") ) {
isBullet = (value != "0");
}
if ( name == _("Mass density") ) {
massDensity = value.To<float>();
}
if ( name == _("Friction") ) {
averageFriction = value.To<float>();
}
if ( name == _("Restitution (elasticity)") ) {
averageRestitution = value.To<float>();
}
if ( name == _("Linear Damping") ) {
if ( value.To<float>() < 0 ) return false;
linearDamping = value.To<float>();
}
if ( name == _("Angular Damping") ) {
if ( value.To<float>() < 0 ) return false;
angularDamping = value.To<float>();
}
return true;
}
#endif
gd::String PhysicsBehavior::GetStringFromCoordsVector(const std::vector<sf::Vector2f> &vec, char32_t coordsSep, char32_t composantSep)
{

View File

@@ -56,6 +56,9 @@ public:
* Called when user wants to edit the behavior.
*/
virtual void EditBehavior( wxWindow* parent, gd::Project & project_, gd::Layout * layout_, gd::MainFrameWrapper & mainFrameWrapper_ );
virtual std::map<gd::String, gd::PropertyDescriptor> GetProperties(gd::Project & project) const;
virtual bool UpdateProperty(const gd::String & name, const gd::String & value, gd::Project & project);
#endif
/**

View File

@@ -137,6 +137,8 @@ gd::PlatformExtension * CreateGDJSInventoryExtension();
gd::PlatformExtension * CreateGDJSLinkedObjectsExtension();
gd::PlatformExtension * CreateGDJSSystemInfoExtension();
gd::PlatformExtension * CreateGDJSShopifyExtension();
gd::PlatformExtension * CreateGDJSPathfindingBehaviorExtension();
gd::PlatformExtension * CreateGDJSPhysicsBehaviorExtension();
}
#endif
@@ -183,6 +185,8 @@ JsPlatform::JsPlatform() :
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSLinkedObjectsExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSSystemInfoExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSShopifyExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSPathfindingBehaviorExtension())); std::cout.flush();
AddExtension(std::shared_ptr<gd::PlatformExtension>(CreateGDJSPhysicsBehaviorExtension())); std::cout.flush();
#endif
std::cout << "done." << std::endl;
};

View File

@@ -1,6 +1,7 @@
gdjs.LayerPixiRenderer = function(layer, runtimeSceneRenderer)
{
this._pixiContainer = new PIXI.Container();
this._filters = {};
this._layer = layer;
runtimeSceneRenderer.getPIXIContainer().addChild(this._pixiContainer);

View File

@@ -86,12 +86,14 @@ gdjs.PixiFiltersTools._filters = {
},
Sepia: {
makeFilter: function() {
return new PIXI.filters.SepiaFilter();
var colorMatrix = new PIXI.filters.ColorMatrixFilter();
colorMatrix.sepia();
return colorMatrix;
},
updateParameter: function(filter, parameterName, value) {
if (parameterName !== 'opacity') return;
filter.sepia = value;
filter.alpha = value;
},
},
};

View File

@@ -1,4 +1,4 @@
# Rename this file as .env.local and complete the following values.
# Copy this file as ".env.local" and complete the following values.
# If values are not completed, some features will be unavailable.
REACT_APP_PREVIEW_S3_ACCESS_KEY_ID=

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,760 @@
{
"firstLayout": "",
"gdVersion": {
"build": 96,
"major": 4,
"minor": 0,
"revision": 0
},
"properties": {
"folderProject": false,
"linuxExecutableFilename": "",
"macExecutableFilename": "",
"packageName": "",
"projectFile": "/Users/florian/Desktop/parallax/parallax.json",
"useExternalSourceFiles": false,
"winExecutableFilename": "",
"winExecutableIconFile": "",
"name": "Project",
"author": "",
"windowWidth": 600,
"windowHeight": 400,
"latestCompilationDirectory": "",
"maxFPS": 60,
"minFPS": 10,
"verticalSync": false,
"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": "Vegetation_(middle_layer).png",
"kind": "image",
"name": "Vegetation_(middle_layer).png",
"smoothed": true,
"userAdded": true
},
{
"alwaysLoaded": false,
"file": "Ground_(front_layer).png",
"kind": "image",
"name": "Ground_(front_layer).png",
"smoothed": true,
"userAdded": true
},
{
"alwaysLoaded": false,
"file": "Sky_back_layer.png",
"kind": "image",
"name": "Sky_back_layer.png",
"smoothed": true,
"userAdded": true
},
{
"alwaysLoaded": false,
"file": "Elisa_standing.png",
"kind": "image",
"name": "Elisa_standing.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": true,
"gridB": 255,
"gridG": 180,
"gridHeight": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridR": 158,
"gridWidth": 32,
"snap": true,
"windowMask": false,
"zoomFactor": 1
},
"objectsGroups": [],
"variables": [],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "",
"locked": false,
"name": "ObjectToFollow",
"width": 0,
"x": -128,
"y": 320,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer4",
"locked": false,
"name": "Background",
"width": 0,
"x": -640,
"y": -32,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer3",
"locked": false,
"name": "Background",
"width": 0,
"x": -640,
"y": -32,
"zOrder": 1,
"numberProperties": [
{
"name": "animation",
"value": 1
}
],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer2",
"locked": false,
"name": "Background",
"width": 0,
"x": -608,
"y": -32,
"zOrder": 1,
"numberProperties": [
{
"name": "animation",
"value": 2
}
],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer3",
"locked": false,
"name": "Background",
"width": 0,
"x": 0,
"y": -32,
"zOrder": 1,
"numberProperties": [
{
"name": "animation",
"value": 1
}
],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer2",
"locked": false,
"name": "Background",
"width": 0,
"x": 0,
"y": -32,
"zOrder": 1,
"numberProperties": [
{
"name": "animation",
"value": 2
}
],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"layer": "Layer4",
"locked": false,
"name": "Background",
"width": 0,
"x": 0,
"y": -32,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"name": "Background",
"type": "Sprite",
"updateIfNotVisible": true,
"variables": [],
"behaviors": [],
"animations": [
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 1,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "Sky_back_layer.png",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
}
]
]
}
]
}
]
},
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 1,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "Vegetation_(middle_layer).png",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
}
]
]
}
]
}
]
},
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 1,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "Ground_(front_layer).png",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
}
]
]
}
]
}
]
}
]
},
{
"name": "ObjectToFollow",
"type": "Sprite",
"updateIfNotVisible": true,
"variables": [],
"behaviors": [],
"animations": [
{
"name": "",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"timeBetweenFrames": 1,
"sprites": [
{
"hasCustomCollisionMask": false,
"image": "Elisa_standing.png",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
},
{
"x": 0,
"y": 0
}
]
]
}
]
}
]
}
]
}
],
"events": [
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "The character can just be moved left and right - in a real game you can use the Platformer character behavior.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Left"
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "AddForceXY"
},
"parameters": [
"ObjectToFollow",
"-200",
"0",
"0"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": false,
"value": "KeyPressed"
},
"parameters": [
"",
"Right"
],
"subInstructions": []
}
],
"actions": [
{
"type": {
"inverted": false,
"value": "AddForceXY"
},
"parameters": [
"ObjectToFollow",
"200",
"0",
"0"
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"inverted": false,
"value": "MoveObjects"
},
"parameters": [
""
],
"subInstructions": []
}
],
"events": []
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Parallax is achieved by setting the position of the camera to the position of the player, multiplied by a factor (between 0 and 1).\nA small factor makes the layer appears far.\nA factor close to 1 makes the layer appears like if it was near the player.",
"comment2": ""
},
{
"disabled": false,
"folded": false,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"inverted": false,
"value": "CameraX"
},
"parameters": [
"",
"=",
"ObjectToFollow.X()",
"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "CameraX"
},
"parameters": [
"",
"=",
"ObjectToFollow.X()*0.75",
"\"Layer2\"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "CameraX"
},
"parameters": [
"",
"=",
"ObjectToFollow.X()*0.50",
"\"Layer3\"",
""
],
"subInstructions": []
},
{
"type": {
"inverted": false,
"value": "CameraX"
},
"parameters": [
"",
"=",
"ObjectToFollow.X()*0.25",
"\"Layer4\"",
""
],
"subInstructions": []
}
],
"events": []
}
],
"layers": [
{
"name": "Layer4",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
},
{
"name": "Layer3",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
},
{
"name": "Layer2",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
},
{
"name": "",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
}
],
"behaviorsSharedData": []
}
],
"externalEvents": [],
"externalLayouts": [],
"externalSourceFiles": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

View File

@@ -425,6 +425,156 @@ Object {
},
},
},
"Pathfinding behavior": Object {
"Destination reached": Object {
"displayedName": "Destination reached",
"fullGroupName": "Pathfinding behavior/",
"type": "PathfindingBehavior::DestinationReached",
},
"Obstacles": Object {
"Cost": Object {
"displayedName": "Cost",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::Cost",
},
"Is object impassable?": Object {
"displayedName": "Is object impassable?",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::IsImpassable",
},
},
"Path": Object {
"Acceleration": Object {
"displayedName": "Acceleration",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Acceleration",
},
"Angular maximum speed": Object {
"displayedName": "Angular maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngularMaxSpeed",
},
"Diagonals moves": Object {
"displayedName": "Diagonals moves",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::DiagonalsAllowed",
},
"Extra border": Object {
"displayedName": "Extra border",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::ExtraBorder",
},
"Maximum speed": Object {
"displayedName": "Maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::MaxSpeed",
},
"Object rotated": Object {
"displayedName": "Object rotated",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::ObjectRotated",
},
"Rotation offset": Object {
"displayedName": "Rotation offset",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngleOffset",
},
"Speed": Object {
"displayedName": "Speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Speed",
},
},
"Path found": Object {
"displayedName": "Path found",
"fullGroupName": "Pathfinding behavior/",
"type": "PathfindingBehavior::PathFound",
},
"Virtual grid": Object {
"Height of the virtual grid": Object {
"displayedName": "Height of the virtual grid",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellHeight",
},
"Width of the virtual grid": Object {
"displayedName": "Width of the virtual grid",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellWidth",
},
},
},
"Physics behavior": Object {
"Collision": Object {
"displayedName": "Collision",
"fullGroupName": "Physics behavior/",
"type": "PhysicsBehavior::CollisionWith",
},
"Collision polygon": Object {
"Collision polygon X scale": Object {
"displayedName": "Collision polygon X scale",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::GetPolygonScaleX",
},
"Collision polygon Y scale": Object {
"displayedName": "Collision polygon Y scale",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::GetPolygonScaleY",
},
},
"Displacement": Object {
"Angular damping": Object {
"displayedName": "Angular damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::AngularDamping",
},
"Linear damping": Object {
"displayedName": "Linear damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearDamping",
},
"Linear speed": Object {
"displayedName": "Linear speed",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocity",
},
"X component": Object {
"displayedName": "X component",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocityX",
},
"Y component": Object {
"displayedName": "Y component",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocityY",
},
},
"Movement": Object {
"The object is dynamic": Object {
"displayedName": "The object is dynamic",
"fullGroupName": "Physics behavior/Movement",
"type": "PhysicsBehavior::IsDynamic",
},
},
"Other": Object {
"Object is treated like a bullet": Object {
"displayedName": "Object is treated like a bullet",
"fullGroupName": "Physics behavior/Other",
"type": "PhysicsBehavior::IsBullet",
},
},
"Rotation": Object {
"Angular speed": Object {
"displayedName": "Angular speed",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::AngularVelocity",
},
"Fixed rotation": Object {
"displayedName": "Fixed rotation",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::IsFixedRotation",
},
},
},
"Platform Behavior": Object {
"Is falling": Object {
"displayedName": "Is falling",
@@ -1703,6 +1853,186 @@ Array [
"fullGroupName": "Shopify",
"type": "Shopify::GetCheckoutUrlForProduct",
},
Object {
"displayedName": "Acceleration",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Acceleration",
},
Object {
"displayedName": "Diagonals moves",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AllowDiagonals",
},
Object {
"displayedName": "Rotation offset",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngleOffset",
},
Object {
"displayedName": "Angular maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngularMaxSpeed",
},
Object {
"displayedName": "Height of the cells",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellHeight",
},
Object {
"displayedName": "Width of the cells",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellWidth",
},
Object {
"displayedName": "Extra border",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::ExtraBorder",
},
Object {
"displayedName": "Maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::MaxSpeed",
},
Object {
"displayedName": "Rotate the object",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::RotateObject",
},
Object {
"displayedName": "Move to a position",
"fullGroupName": "Pathfinding behavior/",
"type": "PathfindingBehavior::SetDestination",
},
Object {
"displayedName": "Speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Speed",
},
Object {
"displayedName": "Cost",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::Cost",
},
Object {
"displayedName": "Should object be impassable?",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::SetImpassable",
},
Object {
"displayedName": "Add a gear between two objects",
"fullGroupName": "Physics behavior/Joints",
"type": "PhysicsBehavior::ActAddGearJointBetweenObjects",
},
Object {
"displayedName": "Add a hinge",
"fullGroupName": "Physics behavior/Joints",
"type": "PhysicsBehavior::AddRevoluteJoint",
},
Object {
"displayedName": "Add a hinge between two objects",
"fullGroupName": "Physics behavior/Joints",
"type": "PhysicsBehavior::AddRevoluteJointBetweenObjects",
},
Object {
"displayedName": "Add a force",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyForce",
},
Object {
"displayedName": "Apply a force toward a position",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyForceTowardPosition",
},
Object {
"displayedName": "Apply a force ( angle )",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyForceUsingPolarCoordinates",
},
Object {
"displayedName": "Apply an impulse",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyImpulse",
},
Object {
"displayedName": "Apply an impulse toward a position",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyImpulseTowardPosition",
},
Object {
"displayedName": "Apply an impulse (angle)",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::ApplyImpulseUsingPolarCoordinates",
},
Object {
"displayedName": "Add a torque (a rotation)",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::ApplyTorque",
},
Object {
"displayedName": "Do not treat object like a bullet",
"fullGroupName": "Physics behavior/Other",
"type": "PhysicsBehavior::DontSetAsBullet",
},
Object {
"displayedName": "Angular damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::SetAngularDamping",
},
Object {
"displayedName": "Angular speed",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::SetAngularVelocity",
},
Object {
"displayedName": "Treat object like a bullet.",
"fullGroupName": "Physics behavior/Other",
"type": "PhysicsBehavior::SetAsBullet",
},
Object {
"displayedName": "Make the object dynamic",
"fullGroupName": "Physics behavior/Movement",
"type": "PhysicsBehavior::SetDynamic",
},
Object {
"displayedName": "Fix rotation",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::SetFixedRotation",
},
Object {
"displayedName": "Make object's rotation free",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::SetFreeRotation",
},
Object {
"displayedName": "Gravity",
"fullGroupName": "Physics behavior/Global options",
"type": "PhysicsBehavior::SetGravity",
},
Object {
"displayedName": "Linear damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::SetLinearDamping",
},
Object {
"displayedName": "Linear velocity",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::SetLinearVelocity",
},
Object {
"displayedName": "Change the X scale of a collision polygon",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::SetPolygonScaleX",
},
Object {
"displayedName": "Change the Y scale of a collision polygon",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::SetPolygonScaleY",
},
Object {
"displayedName": "Make the object static",
"fullGroupName": "Physics behavior/Movement",
"type": "PhysicsBehavior::SetStatic",
},
]
`;
@@ -2378,5 +2708,135 @@ Array [
"fullGroupName": "System information",
"type": "SystemInfo::IsMobile",
},
Object {
"displayedName": "Acceleration",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Acceleration",
},
Object {
"displayedName": "Rotation offset",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngleOffset",
},
Object {
"displayedName": "Angular maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::AngularMaxSpeed",
},
Object {
"displayedName": "Height of the virtual grid",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellHeight",
},
Object {
"displayedName": "Width of the virtual grid",
"fullGroupName": "Pathfinding behavior/Virtual grid",
"type": "PathfindingBehavior::CellWidth",
},
Object {
"displayedName": "Destination reached",
"fullGroupName": "Pathfinding behavior/",
"type": "PathfindingBehavior::DestinationReached",
},
Object {
"displayedName": "Diagonals moves",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::DiagonalsAllowed",
},
Object {
"displayedName": "Extra border",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::ExtraBorder",
},
Object {
"displayedName": "Maximum speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::MaxSpeed",
},
Object {
"displayedName": "Object rotated",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::ObjectRotated",
},
Object {
"displayedName": "Path found",
"fullGroupName": "Pathfinding behavior/",
"type": "PathfindingBehavior::PathFound",
},
Object {
"displayedName": "Speed",
"fullGroupName": "Pathfinding behavior/Path",
"type": "PathfindingBehavior::Speed",
},
Object {
"displayedName": "Cost",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::Cost",
},
Object {
"displayedName": "Is object impassable?",
"fullGroupName": "Pathfinding behavior/Obstacles",
"type": "PathfindingBehavior::IsImpassable",
},
Object {
"displayedName": "Angular damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::AngularDamping",
},
Object {
"displayedName": "Angular speed",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::AngularVelocity",
},
Object {
"displayedName": "Collision",
"fullGroupName": "Physics behavior/",
"type": "PhysicsBehavior::CollisionWith",
},
Object {
"displayedName": "Collision polygon X scale",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::GetPolygonScaleX",
},
Object {
"displayedName": "Collision polygon Y scale",
"fullGroupName": "Physics behavior/Collision polygon",
"type": "PhysicsBehavior::GetPolygonScaleY",
},
Object {
"displayedName": "Object is treated like a bullet",
"fullGroupName": "Physics behavior/Other",
"type": "PhysicsBehavior::IsBullet",
},
Object {
"displayedName": "The object is dynamic",
"fullGroupName": "Physics behavior/Movement",
"type": "PhysicsBehavior::IsDynamic",
},
Object {
"displayedName": "Fixed rotation",
"fullGroupName": "Physics behavior/Rotation",
"type": "PhysicsBehavior::IsFixedRotation",
},
Object {
"displayedName": "Linear damping",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearDamping",
},
Object {
"displayedName": "Linear speed",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocity",
},
Object {
"displayedName": "X component",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocityX",
},
Object {
"displayedName": "Y component",
"fullGroupName": "Physics behavior/Displacement",
"type": "PhysicsBehavior::LinearVelocityY",
},
]
`;

View File

@@ -5,6 +5,7 @@ import BrowserPreviewLinkDialog from './BrowserPreviewLinkDialog';
import { findGDJS } from './BrowserS3GDJSFinder';
import assignIn from 'lodash/assignIn';
import { GDevelopGamesPreview } from '../../Utils/GDevelopServices/ApiConfigs';
import { makeTimestampedId } from '../../Utils/TimestampedId';
const awsS3 = require('aws-sdk/clients/s3');
const gd = global.gd;
@@ -41,8 +42,7 @@ export default class BrowserS3PreviewLauncher {
}
console.info('GDJS found in ', gdjsRoot);
const prefix =
'' + Date.now() + '-' + Math.floor(Math.random() * 1000000);
const prefix = makeTimestampedId();
const outputDir = destinationBucketBaseUrl + prefix;
const browserS3FileSystem = new BrowserS3FileSystem({

View File

@@ -8,6 +8,7 @@ import optionalRequire from '../../Utils/OptionalRequire';
import { Column, Line, Spacer } from '../../UI/Grid';
import LinearProgress from 'material-ui/LinearProgress';
import { GDevelopHostingApi } from '../../Utils/GDevelopServices/ApiConfigs';
import { makeTimestampedId } from '../../Utils/TimestampedId';
import TextField from 'material-ui/TextField';
const os = optionalRequire('os');
const electron = optionalRequire('electron');
@@ -31,11 +32,13 @@ export default class LocalS3Export extends Component {
ipcRenderer.removeAllListeners('s3-folder-upload-done');
return new Promise((resolve, reject) => {
ipcRenderer.on('s3-folder-upload-progress', (event, uploadProgress, uploadMax) =>
this.setState({
uploadProgress,
uploadMax,
})
ipcRenderer.on(
's3-folder-upload-progress',
(event, uploadProgress, uploadMax) =>
this.setState({
uploadProgress,
uploadMax,
})
);
ipcRenderer.on('s3-folder-upload-done', (event, err, prefix) => {
if (err) return reject(err);
@@ -51,7 +54,8 @@ export default class LocalS3Export extends Component {
_deploy = prefix => {
return sleep(200)
.then(() => //TODO: Move this to a GDevelopServices/Hosting.js file
.then(() =>
//TODO: Move this to a GDevelopServices/Hosting.js file
axios(GDevelopHostingApi.deployEndpoint, {
method: 'post',
params: {
@@ -79,7 +83,7 @@ export default class LocalS3Export extends Component {
deployDone: false,
});
const outputDir = os.tmpdir() + '/GDS3Export';
const outputDir = os.tmpdir() + '/GDS3Export-' + makeTimestampedId();
LocalExport.prepareExporter()
.then(({ exporter }) => {
const exportForCordova = false;

View File

@@ -17,6 +17,7 @@ import Authentification, {
import LoginDialog from './LoginDialog';
import { watchPromiseInState } from '../Utils/WatchPromiseInState';
import { showWarningBox } from '../UI/Messages/MessageBox';
import { sendSignupDone } from '../Utils/Analytics/EventSender';
type Props = {
open: boolean,
@@ -181,6 +182,7 @@ export const withUserProfile = (
() => {
this._fetchUserProfile();
this.openLogin(false);
sendSignupDone(form.email);
},
(loginError: LoginError) => {
this.setState({

View File

@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import FlatButton from 'material-ui/FlatButton';
import Subheader from 'material-ui/Subheader';
import { List, ListItem } from 'material-ui/List';
import { sendNewGameCreated } from '../Utils/Analytics/EventSender';
import { Column, Line } from '../UI/Grid';
@@ -13,25 +14,66 @@ export default class LocalCreateDialog extends Component {
</Column>
</Line>
<Line>
<Column expand>
<FlatButton
label="Platformer"
fullWidth
primary
onClick={() => {
sendNewGameCreated('platformer');
this.props.onOpen('internal://platformer');
}}
/>
<FlatButton
label="Space Shooter"
fullWidth
primary
onClick={() => {
sendNewGameCreated('space-shooter');
this.props.onOpen('internal://space-shooter');
}}
/>
<Column expand noMargin>
<List>
<Subheader>Starters</Subheader>
<ListItem
primaryText="Platformer"
secondaryText={
<p>
A simple platform game, with coins to collect, moving
platforms and enemies.
</p>
}
secondaryTextLines={2}
onClick={() => {
sendNewGameCreated('platformer');
this.props.onOpen('internal://platformer');
}}
/>
<ListItem
primaryText="Space Shooter"
secondaryText={
<p>
A side-scrolling shooter where you must defeat incoming
enemies with your spaceship.
</p>
}
secondaryTextLines={2}
onClick={() => {
sendNewGameCreated('space-shooter');
this.props.onOpen('internal://space-shooter');
}}
/>
<Subheader>Examples</Subheader>
<ListItem
primaryText="Physics"
secondaryText={
<p>
Example showing how to configure physics behavior on objects and use events to detect collisions.
</p>
}
secondaryTextLines={2}
onClick={() => {
sendNewGameCreated('physics');
this.props.onOpen('internal://physics');
}}
/>
<ListItem
primaryText="Pathfinding"
secondaryText={
<p>
Example showing how to move a tank avoiding obstacles on the
battlefield.
</p>
}
secondaryTextLines={2}
onClick={() => {
sendNewGameCreated('pathfinding');
this.props.onOpen('internal://pathfinding');
}}
/>
</List>
</Column>
</Line>
</Column>

View File

@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import LocalFolderPicker from '../UI/LocalFolderPicker';
import { sendNewGameCreated } from '../Utils/Analytics/EventSender';
import { Column, Line } from '../UI/Grid';
@@ -74,6 +75,7 @@ export default class LocalCreateDialog extends Component {
<Line>
<Column expand noMargin>
<List>
<Subheader>Starters</Subheader>
<ListItem
primaryText="Platformer"
secondaryText={
@@ -102,6 +104,31 @@ export default class LocalCreateDialog extends Component {
secondaryTextLines={2}
onClick={() => this.createEmptyGame()}
/>
<Subheader>Examples</Subheader>
<ListItem
primaryText="Physics"
secondaryText={<p>Example showing how to configure physics behavior on objects and use events to detect collisions.</p>}
secondaryTextLines={2}
onClick={() => this.createFromExample('physics')}
/>
<ListItem
primaryText="Pathfinding"
secondaryText={<p>Example showing how to move a tank avoiding obstacles on the battlefield.</p>}
secondaryTextLines={2}
onClick={() => this.createFromExample('pathfinding')}
/>
<ListItem
primaryText="Zombie laser"
secondaryText={<p>Example with procedural terrain generation, laser with Shape painter object and usage of pathfinding to move zombies toward the player.</p>}
secondaryTextLines={2}
onClick={() => this.createFromExample('zombie-laser')}
/>
<ListItem
primaryText="Parallax background"
secondaryText={<p>Very simple example showing how to have a background with multiple layers and a parallax effect.</p>}
secondaryTextLines={2}
onClick={() => this.createFromExample('parallax')}
/>
</List>
</Column>
</Line>

View File

@@ -1,5 +1,7 @@
import platformer from '../fixtures/platformer/platformer.json';
import spaceShooter from '../fixtures/space-shooter/space-shooter.json';
import pathfinding from '../fixtures/pathfinding/pathfinding.json';
import physics from '../fixtures/physics/physics.json';
export default class BrowserProjectOpener {
static readInternalFile(url) {
@@ -7,6 +9,10 @@ export default class BrowserProjectOpener {
return Promise.resolve(platformer);
} else if (url === 'internal://space-shooter') {
return Promise.resolve(spaceShooter);
} else if (url === 'internal://pathfinding') {
return Promise.resolve(pathfinding);
} else if (url === 'internal://physics') {
return Promise.resolve(physics);
}
return Promise.reject(`Unknown built-in game with URL ${url}`);

View File

@@ -35,6 +35,8 @@ export default class PropertiesEditor extends Component {
}
_renderEditField = field => {
if (field.name === 'PLEASE_ALSO_SHOW_EDIT_BUTTON_THANKS') return null; // This special property was used in GDevelop 4 IDE to ask for a Edit button to be shown, ignore it.
if (field.valueType === 'boolean') {
return (
<Checkbox

View File

@@ -117,3 +117,11 @@ export const sendErrorMessage = (errorMessage, type, rawError) => {
rawError,
});
};
export const sendSignupDone = email => {
if (isDev) return;
client.recordEvent('signup', {
email,
});
};

View File

@@ -42,13 +42,13 @@ export const GDevelopFirebaseConfig = {
export const GDevelopUsageApi = {
baseUrl: isDev
? 'https://dwjjhr5k76.execute-api.us-east-1.amazonaws.com/dev'
: 'https://0sm32zmich.execute-api.us-east-1.amazonaws.com/live',
: 'https://api.gdevelop-app.com/usage',
};
export const GDevelopBuildApi = {
baseUrl: isDev
? 'https://ppvvhs48j1.execute-api.us-east-1.amazonaws.com/dev'
: 'https://21fixz45y2.execute-api.us-east-1.amazonaws.com/live',
: 'https://api.gdevelop-app.com/build',
};
export const StripeCheckoutConfig = {

View File

@@ -0,0 +1,4 @@
// @flow
export const makeTimestampedId = () =>
'' + Date.now() + '-' + Math.floor(Math.random() * 1000000);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
# Copy this file as ".env" and complete the following values.
# If values are not completed, some features will be unavailable.
UPLOAD_S3_ACCESS_KEY_ID=
UPLOAD_S3_SECRET_ACCESS_KEY=

View File

@@ -1,2 +1,3 @@
dist/
app/www/
.env

View File

@@ -0,0 +1,119 @@
const fs = require('fs');
const path = require('path');
const async = require('async');
const awsS3 = require('aws-sdk/clients/s3');
const { makeTimestampedId } = require('./Utils/TimestampedId');
const recursive = require('recursive-readdir');
const accessKeyId = process.env.UPLOAD_S3_ACCESS_KEY_ID;
const secretAccessKey = process.env.UPLOAD_S3_SECRET_ACCESS_KEY;
const destinationBucket = `gd-games-in`;
const region = 'eu-west-1';
const mime = {
'.js': 'text/javascript',
'.html': 'text/html',
};
if (!accessKeyId || !secretAccessKey) {
console.warn(
"⚠️ Either UPLOAD_S3_ACCESS_KEY_ID or UPLOAD_S3_SECRET_ACCESS_KEY are not defined. Upload won't be working."
);
console.info(
' Copy .env.dist file to .env and fill the values to fix this warning.'
);
}
module.exports = {
/**
* Upload the specified directory to GDevelop
* Amazon S3 inbound bucket.
*/
uploadGameFolderToBucket: (localDir, onProgress, onDone) => {
if (!accessKeyId || !secretAccessKey) {
onDone('Missing S3 configuration');
return;
}
const awsS3Client = new awsS3({
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: region,
correctClockSkew: true,
});
const prefix = 'game-' + makeTimestampedId();
recursive(localDir)
.then(allFiles => {
const updateProgress = (fileIndex, loaded, total) => {
onProgress(fileIndex + (total ? loaded / total : 0), allFiles.length);
};
async.series(
allFiles.map((localFile, fileIndex) => callback => {
const body = fs.createReadStream(localFile);
const filename = path.relative(localDir, localFile);
const fileExtension = path.extname(filename);
awsS3Client
.upload({
Body: body,
Bucket: destinationBucket,
Key: prefix + '/' + filename,
ContentType: mime[fileExtension],
})
.on('httpUploadProgress', function(progress) {
updateProgress(fileIndex, progress.loaded, progress.total || 0);
})
.send(function(err, data) {
callback(err, prefix + '/' + filename);
});
}),
(err, results) => {
if (err) {
onDone(err);
}
onDone(null, prefix);
}
);
})
.catch(err => {
console.error('Unable to recursively read directory ' + localDir);
onDone(err);
});
},
/**
* Upload the specified file to GDevelop
* Amazon S3 inbound bucket.
*/
uploadArchiveToBucket: (localFile, onProgress, onDone) => {
if (!accessKeyId || !secretAccessKey) {
onDone('Missing S3 configuration');
return;
}
const awsS3Client = new awsS3({
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: region,
correctClockSkew: true,
});
const prefix = 'game-archive-' + makeTimestampedId();
const filename = 'game-archive.zip';
const body = fs.createReadStream(localFile);
awsS3Client
.upload({
Body: body,
Bucket: destinationBucket,
Key: prefix + '/' + filename,
})
.on('httpUploadProgress', function(progress) {
onProgress(progress.loaded, progress.total || 0);
})
.send(function(err, data) {
onDone(err, prefix + '/' + filename);
});
},
};

View File

@@ -0,0 +1,8 @@
// @flow
const makeTimestampedId = () =>
'' + Date.now() + '-' + Math.floor(Math.random() * 1000000);
module.exports = {
makeTimestampedId,
};

View File

@@ -1,3 +1,4 @@
require('dotenv').config();
const electron = require('electron');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
@@ -10,8 +11,8 @@ const log = require('electron-log');
const {
uploadGameFolderToBucket,
uploadArchiveToBucket,
} = require('./s3upload');
const { buildMainMenuFor } = require('./main-menu');
} = require('./S3Upload');
const { buildMainMenuFor } = require('./MainMenu');
const throttle = require('lodash.throttle');
// Logs made with electron-logs can be found
@@ -102,9 +103,9 @@ app.on('ready', function() {
uploadGameFolderToBucket(
localDir,
(current, max) => {
throttle((current, max) => {
event.sender.send('s3-folder-upload-progress', current, max);
},
}, 200),
(err, prefix) => {
event.sender.send('s3-folder-upload-done', err, prefix);
}

View File

@@ -1,6 +1,6 @@
{
"name": "gdevelop-electron-app",
"version": "5.0.0-beta13",
"name": "gdevelop",
"version": "5.0.0-beta19",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -287,19 +287,6 @@
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
},
"fd-slicer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
"requires": {
"pend": "1.2.0"
}
},
"findit2": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz",
"integrity": "sha1-WKRmaX34piBc39vzlVNri9d3pfY="
},
"fs-extra": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz",
@@ -469,11 +456,6 @@
"resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
"integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ="
},
"mime": {
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
"integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -487,31 +469,11 @@
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"natives": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/natives/-/natives-1.1.1.tgz",
"integrity": "sha512-8eRaxn8u/4wN8tGkhlc2cgwwvOLMLUMUn4IYTexMgWd+LyUDfeXVkk2ygQR0hvIHbJQXgHujia3ieUUDwNGkEA=="
},
"normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
@@ -533,11 +495,6 @@
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"pend": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
@@ -567,16 +524,29 @@
"util-deprecate": "1.0.2"
}
},
"recursive-readdir": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.1.tgz",
"integrity": "sha1-kO8jHQd4xc4JPJpI105cVCLROpk=",
"requires": {
"minimatch": "3.0.3"
},
"dependencies": {
"minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=",
"requires": {
"brace-expansion": "1.1.8"
}
}
}
},
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
"integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8="
},
"rimraf": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI="
},
"ripemd160": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz",
@@ -586,59 +556,6 @@
"inherits": "2.0.3"
}
},
"s3": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/s3/-/s3-4.4.0.tgz",
"integrity": "sha1-VqT3dVFae2ucjlxrGrUfkDdmnx8=",
"requires": {
"aws-sdk": "2.0.31",
"fd-slicer": "1.0.1",
"findit2": "2.2.3",
"graceful-fs": "3.0.11",
"mime": "1.2.11",
"mkdirp": "0.5.1",
"pend": "1.2.0",
"rimraf": "2.2.8",
"streamsink": "1.2.0"
},
"dependencies": {
"aws-sdk": {
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.0.31.tgz",
"integrity": "sha1-5yzx/caQFb2f0r3z07iMFlB9Jo4=",
"requires": {
"xml2js": "0.2.6",
"xmlbuilder": "0.4.2"
}
},
"graceful-fs": {
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz",
"integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
"requires": {
"natives": "1.1.1"
}
},
"sax": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.4.2.tgz",
"integrity": "sha1-OfO2AXM9a+yXEFskKipA/Wl4rDw="
},
"xml2js": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.6.tgz",
"integrity": "sha1-0gnE5N2h/JxFIUHvQcB39a399sQ=",
"requires": {
"sax": "0.4.2"
}
},
"xmlbuilder": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.4.2.tgz",
"integrity": "sha1-F3bWXz/brUcKCNhgTN6xxOVA/4M="
}
}
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
@@ -681,11 +598,6 @@
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
},
"streamsink": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/streamsink/-/streamsink-1.2.0.tgz",
"integrity": "sha1-76/unx4i01ke1949yqlcP1559zw="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",

View File

@@ -1,14 +1,15 @@
{
"name": "gdevelop-electron-app",
"name": "gdevelop",
"productName": "GDevelop 5",
"description": "GDevelop 5 IDE running on the Electron runtime",
"version": "5.0.0-beta16",
"version": "5.0.0-beta21",
"author": "Florian Rival",
"license": "MIT",
"homepage": "http://compilgames.net",
"main": "main.js",
"dependencies": {
"archiver": "^2.1.1",
"async": "^2.6.0",
"aws-sdk": "^2.58.0",
"electron-editor-context-menu": "^1.1.1",
"electron-is": "^2.4.0",
@@ -17,6 +18,6 @@
"fs-extra": "^3.0.1",
"lodash.throttle": "^4.1.1",
"minimist": "^1.2.0",
"s3": "^4.4.0"
"recursive-readdir": "^2.2.1"
}
}

View File

@@ -1,77 +0,0 @@
const fs = require('fs');
const s3 = require('s3');
const awsS3 = require('aws-sdk/clients/s3');
const destinationBucket = `gd-games-in`;
const accessKeyId = 'AKIAJPLGZ22GBISUYFJQ';
const secretAccessKey = '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';
const region = 'eu-west-1';
module.exports = {
/**
* Upload the specified directory to GDevelop
* Amazon S3 inbound bucket.
*/
uploadGameFolderToBucket: (localDir, onProgress, onDone) => {
const awsS3Client = new awsS3({
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: region,
correctClockSkew: true,
});
// TODO: Switch to a more robust module for uploading files
const s3Client = s3.createClient({
s3Client: awsS3Client,
});
const timestamp = '' + Date.now();
const prefix = 'game-' + timestamp;
var uploader = s3Client.uploadDir({
localDir,
s3Params: {
Bucket: destinationBucket,
Prefix: prefix + '/',
},
});
uploader.on('error', onDone);
uploader.on('progress', function() {
onProgress(uploader.progressAmount, uploader.progressTotal);
});
uploader.on('end', function() {
onDone(null, prefix);
});
},
/**
* Upload the specified file to GDevelop
* Amazon S3 inbound bucket.
*/
uploadArchiveToBucket: (localFile, onProgress, onDone) => {
const awsS3Client = new awsS3({
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: region,
correctClockSkew: true,
});
const timestamp = '' + Date.now();
const prefix = 'game-archive-' + timestamp;
const filename = 'game-archive.zip';
var body = fs.createReadStream(localFile);
awsS3Client
.upload({
Body: body,
Bucket: destinationBucket,
Key: prefix + '/' + filename,
})
.on('httpUploadProgress', function(progress) {
onProgress(progress.loaded, progress.total || 0);
})
.send(function(err, data) {
onDone(err, prefix + '/' + filename);
});
},
};

2754
newIDE/electron-app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"name": "gdevelop-electron",
"name": "gdevelop",
"productName": "GDevelop 5",
"description": "GDevelop 5 IDE running on the Electron runtime",
"version": "1.0.0",
@@ -14,7 +14,7 @@
"build": "node scripts/build.js"
},
"build": {
"appId": "com.gdevelop.ide",
"appId": "com.gdevelop-app.ide",
"extraResources": [
{
"from": "../app/resources/examples",
@@ -28,7 +28,11 @@
"mac": {
"category": "public.app-category.developer-tools"
},
"publish": [{"provider": "github"}]
"publish": [
{
"provider": "github"
}
]
},
"devDependencies": {
"electron": "1.7.9",
@@ -37,6 +41,7 @@
"shelljs": "^0.7.7"
},
"dependencies": {
"dotenv": "^4.0.0",
"electron-is": "^2.4.0"
}
}