diff --git a/ECS-Core.package/ECSInputSystem.class/instance/update.st b/ECS-Core.package/ECSInputSystem.class/instance/update.st index c5f9d62..a23ed21 100644 --- a/ECS-Core.package/ECSInputSystem.class/instance/update.st +++ b/ECS-Core.package/ECSInputSystem.class/instance/update.st @@ -8,8 +8,5 @@ update entities do: [:entity | | action | action := entity inputComponent keyActionMapping at: (self getCharacterForKey: self lastEvent keyValue) ifAbsent: [^ #nothing]. self perform: (action, ':') asSymbol with: entity]. - self lastEvent: nil. -"entity motionComponent velocity: (movementDirections - at: (self getCharacterForKey: self lastEvent keyValue) - ifAbsent: entity motionComponent velocity" \ No newline at end of file + self lastEvent: nil \ No newline at end of file diff --git a/ECS-Core.package/ECSInputSystem.class/methodProperties.json b/ECS-Core.package/ECSInputSystem.class/methodProperties.json index 32cc864..3ca2b99 100644 --- a/ECS-Core.package/ECSInputSystem.class/methodProperties.json +++ b/ECS-Core.package/ECSInputSystem.class/methodProperties.json @@ -23,4 +23,4 @@ "shoot:" : "AR 7/9/2018 16:50", "supportedPlatformDict" : "ek 7/1/2018 23:28", "teleport:" : "AR 7/9/2018 20:55", - "update" : "AR 7/6/2018 11:46" } } + "update" : "ek 7/26/2018 11:24" } } diff --git a/ECS-Presentation.package/ECSECSWidget.class/instance/componentTypeTemplate.st b/ECS-Presentation.package/ECSECSWidget.class/instance/componentTypeTemplate.st index 489d68b..1c65d6d 100644 --- a/ECS-Presentation.package/ECSECSWidget.class/instance/componentTypeTemplate.st +++ b/ECS-Presentation.package/ECSECSWidget.class/instance/componentTypeTemplate.st @@ -3,4 +3,4 @@ componentTypeTemplate ^ 'type - ^ #path' \ No newline at end of file + ^ #{1}' \ No newline at end of file diff --git a/ECS-Presentation.package/ECSECSWidget.class/instance/createComponent.withFields..st b/ECS-Presentation.package/ECSECSWidget.class/instance/createComponent.withFields..st index 33bd41e..156e3cf 100644 --- a/ECS-Presentation.package/ECSECSWidget.class/instance/createComponent.withFields..st +++ b/ECS-Presentation.package/ECSECSWidget.class/instance/createComponent.withFields..st @@ -1,7 +1,9 @@ initialization createComponent: aComponentName withFields: componentFields - | componentClass componentFieldNames defaultValueSetter | + | componentClass componentFieldNames defaultValueSetter componentSuffix | + componentSuffix := 'Component'. + componentFieldNames := componentFields collect: [:componentField | componentField first]. componentClass := (MCClassDefinition name: aComponentName superclassName: 'ECSComponent' category: 'ECS-Custom' instVarNames: componentFieldNames comment: '') createClass. componentClass allInstVarNames do: [:instVar | @@ -9,5 +11,5 @@ createComponent: aComponentName withFields: componentFields defaultValueSetter := componentFields collect: [:componentField | 'instance {1}: {2}.' format: componentField]. componentClass class compile: (self componentConstructorTemplate format: { defaultValueSetter inject: '' into: [:el :result | result , ' ', el]}). - componentClass class compile: self componentTypeTemplate. + componentClass class compile: (self componentTypeTemplate format: {((aComponentName readStream upToAll: componentSuffix) asLowercase)}). ^ componentClass \ No newline at end of file diff --git a/ECS-Presentation.package/ECSECSWidget.class/methodProperties.json b/ECS-Presentation.package/ECSECSWidget.class/methodProperties.json index 65cdfea..baf247d 100644 --- a/ECS-Presentation.package/ECSECSWidget.class/methodProperties.json +++ b/ECS-Presentation.package/ECSECSWidget.class/methodProperties.json @@ -16,7 +16,7 @@ "componentConstructorTemplate" : "AR 6/24/2018 13:50", "componentSidebar" : "ek 5/14/2018 13:56", "componentSidebar:" : "ek 5/14/2018 13:56", - "componentTypeTemplate" : "ek 7/10/2018 21:29", + "componentTypeTemplate" : "ek 7/26/2018 11:57", "componentsForEntityWidget" : "ek 6/22/2018 14:43", "componentsForEntityWidget:" : "ek 6/22/2018 14:43", "configureChooseEntityButton" : "ek 6/22/2018 16:26", @@ -24,7 +24,7 @@ "configureComponentDropdownButtonForCurrentEntity" : "ek 6/22/2018 15:45", "configureComponentDropdownButtonIfNeeded" : "ek 6/22/2018 15:43", "configureUIElementsIfNeeded" : "ek 6/22/2018 16:23", - "createComponent:withFields:" : "ek 7/10/2018 21:29", + "createComponent:withFields:" : "ek 7/26/2018 12:01", "createComponentButton:" : "AR 6/22/2018 15:01", "createComponentSidebar" : "ek 7/10/2018 14:58", "createComponentsForEntityLabel" : "ek 6/22/2018 15:17", diff --git a/ECS-Presentation.package/ECSFinalPresentation.class/instance/initializeFirstSlide.st b/ECS-Presentation.package/ECSFinalPresentation.class/instance/initializeFirstSlide.st index 3b30095..90020bd 100644 --- a/ECS-Presentation.package/ECSFinalPresentation.class/instance/initializeFirstSlide.st +++ b/ECS-Presentation.package/ECSFinalPresentation.class/instance/initializeFirstSlide.st @@ -16,7 +16,7 @@ initializeFirstSlide add: ((PHLabel text: 'by Alexander Riese, Eva Krebs') align: #(center center); pointSize: 40); - add: ((PHLabel text: 'Prof. Dr. Robert Hirschfeld, Jens Lincke, Stefan Ramson') + add: ((PHLabel text: 'Prof. Dr. Robert Hirschfeld, Dr. Jens Lincke, Stefan Ramson') align: #(center center); pointSize: 40); add: ((PHLabel text: '11 July 2018 - Summer term 2018 - Hasso Plattner Institute - Software Architectures Group') diff --git a/ECS-Presentation.package/ECSFinalPresentation.class/instance/wantsToBeDroppedInto..st b/ECS-Presentation.package/ECSFinalPresentation.class/instance/wantsToBeDroppedInto..st deleted file mode 100644 index 2a96cbc..0000000 --- a/ECS-Presentation.package/ECSFinalPresentation.class/instance/wantsToBeDroppedInto..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -wantsToBeDroppedInto: aMorph - - ^ false \ No newline at end of file diff --git a/ECS-Presentation.package/ECSFinalPresentation.class/methodProperties.json b/ECS-Presentation.package/ECSFinalPresentation.class/methodProperties.json index b248a67..75dc2bb 100644 --- a/ECS-Presentation.package/ECSFinalPresentation.class/methodProperties.json +++ b/ECS-Presentation.package/ECSFinalPresentation.class/methodProperties.json @@ -33,11 +33,10 @@ "createTask3Slide" : "ek 7/9/2018 11:48", "handlesKeyboard:" : "ek 7/1/2018 23:45", "initialize" : "ek 7/10/2018 22:40", - "initializeFirstSlide" : "ek 7/9/2018 13:47", + "initializeFirstSlide" : "ek 7/11/2018 11:00", "keyDown:" : "ek 7/1/2018 23:51", "keyMapping" : "ek 7/1/2018 23:54", "keyUp:" : "ek 7/1/2018 23:56", "outOfWorld:" : "ek 7/10/2018 00:36", "spacePressed" : "ek 7/1/2018 23:55", - "spacePressed:" : "ek 7/1/2018 23:55", - "wantsToBeDroppedInto:" : "ek 7/10/2018 22:44" } } + "spacePressed:" : "ek 7/1/2018 23:55" } } diff --git a/ECS-Presentation.package/ECSPresetMVG.class/instance/initializePresetEntities.st b/ECS-Presentation.package/ECSPresetMVG.class/instance/initializePresetEntities.st index f657161..52138fb 100644 --- a/ECS-Presentation.package/ECSPresetMVG.class/instance/initializePresetEntities.st +++ b/ECS-Presentation.package/ECSPresetMVG.class/instance/initializePresetEntities.st @@ -1,7 +1,7 @@ as yet unclassified initializePresetEntities - | player dwarf spawn1 spawn2 bush block1 block2 block3 block4 block5 bush2 bush3 | + | player dwarf spawn1 spawn2 bush block1 block2 block3 block4 block5 bush2 bush3 inputDwarf | super initializePresetEntities. player := self addEntityNamed: 'Mage'. @@ -17,11 +17,19 @@ initializePresetEntities player positionComponent position: 200@200. player teleportComponent teleportArea: 750@400. + inputDwarf := ECSInputComponent withStandardValues. + inputDwarf keyActionMapping: Dictionary new. + inputDwarf keyActionMapping at: $w put: #moveUp. + inputDwarf keyActionMapping at: $s put: #moveDown. + inputDwarf keyActionMapping at: $a put: #moveLeft. + inputDwarf keyActionMapping at: $d put: #moveRight. + dwarf := self addEntityNamed: 'Dwarf'. dwarf addComponent: ECSPositionComponent withStandardValues. dwarf addComponent: ECSPictureComponent withStandardValues. dwarf addComponent: ECSHealthComponent withStandardValues. dwarf addComponent: (ECSCollisionComponent withStandardValues collisionTags: #(destroy)). + dwarf addComponent: inputDwarf. dwarf pictureComponent picturePath: 'dwarf'. dwarf positionComponent position: 0@400. diff --git a/ECS-Presentation.package/ECSPresetMVG.class/methodProperties.json b/ECS-Presentation.package/ECSPresetMVG.class/methodProperties.json index e62eada..2ca06d9 100644 --- a/ECS-Presentation.package/ECSPresetMVG.class/methodProperties.json +++ b/ECS-Presentation.package/ECSPresetMVG.class/methodProperties.json @@ -3,4 +3,4 @@ }, "instance" : { "initialize" : "ek 7/9/2018 15:41", - "initializePresetEntities" : "ek 7/10/2018 21:57" } } + "initializePresetEntities" : "ek 7/11/2018 10:44" } }