Merge branch 'master' of github.com:thecodingmachine/workadventure into map-v0

This commit is contained in:
David Négrier 2020-04-26 21:48:57 +02:00
commit e7bbe29123
4 changed files with 32 additions and 16 deletions

View File

@ -81,17 +81,17 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
msg: Environment deployed at http://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com msg: Environment deployed at https://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com
check_for_duplicate_msg: true check_for_duplicate_msg: true
- name: Run Cypress tests - name: Run Cypress tests
uses: cypress-io/github-action@v1 uses: cypress-io/github-action@v1
env: env:
CYPRESS_BASE_URL: http://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com CYPRESS_BASE_URL: https://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com
with: with:
env: host=${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com,port=80 env: host=${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com,port=80
spec: cypress/integration/spec.js spec: cypress/integration/spec.js
wait-on: http://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com wait-on: https://${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com
working-directory: e2e working-directory: e2e
- name: "Upload the screenshot on test failure" - name: "Upload the screenshot on test failure"

View File

@ -6,7 +6,10 @@
"containers": { "containers": {
"back": { "back": {
"image": "thecodingmachine/workadventure-back:"+tag, "image": "thecodingmachine/workadventure-back:"+tag,
"host": "api."+namespace+".workadventure.test.thecodingmachine.com", "host": {
"url": "api."+namespace+".workadventure.test.thecodingmachine.com",
"https": "enable"
},
"ports": [8080], "ports": [8080],
"env": { "env": {
"SECRET_KEY": "tempSecretKeyNeedsToChange" "SECRET_KEY": "tempSecretKeyNeedsToChange"
@ -14,11 +17,19 @@
}, },
"front": { "front": {
"image": "thecodingmachine/workadventure-front:"+tag, "image": "thecodingmachine/workadventure-front:"+tag,
"host": namespace+".workadventure.test.thecodingmachine.com", "host": {
"url": namespace+".workadventure.test.thecodingmachine.com",
"https": "enable"
},
"ports": [80], "ports": [80],
"env": { "env": {
"API_URL": "http://api."+namespace+".workadventure.test.thecodingmachine.com" "API_URL": "https://api."+namespace+".workadventure.test.thecodingmachine.com"
} }
}
},
"config": {
"https": {
"mail": "d.negrier@thecodingmachine.com"
} }
} }
} }

View File

@ -186,8 +186,12 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
}); });
} }
update() : void { /**
this.CurrentPlayer.moveUser(); * @param time
* @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
*/
update(time: number, delta: number) : void {
this.CurrentPlayer.moveUser(delta);
} }
/** /**

View File

@ -9,7 +9,7 @@ export interface CurrentGamerInterface extends PlayableCaracter{
userId : string; userId : string;
PlayerValue : string; PlayerValue : string;
initAnimation() : void; initAnimation() : void;
moveUser() : void; moveUser(delta: number) : void;
say(text : string) : void; say(text : string) : void;
} }
@ -57,31 +57,32 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G
}) })
} }
moveUser(): void { moveUser(delta: number): void {
//if user client on shift, camera and player speed //if user client on shift, camera and player speed
let haveMove = false; let haveMove = false;
let direction = null; let direction = null;
let activeEvents = this.userInputManager.getEventListForGameTick(); let activeEvents = this.userInputManager.getEventListForGameTick();
let speedMultiplier = activeEvents.get(UserInputEvent.SpeedUp) ? 500 : 100; let speedMultiplier = activeEvents.get(UserInputEvent.SpeedUp) ? 25 : 9;
let moveAmount = speedMultiplier * delta;
if (activeEvents.get(UserInputEvent.MoveUp)) { if (activeEvents.get(UserInputEvent.MoveUp)) {
this.move(0, -speedMultiplier); this.move(0, -moveAmount);
haveMove = true; haveMove = true;
direction = PlayerAnimationNames.WalkUp; direction = PlayerAnimationNames.WalkUp;
} }
if (activeEvents.get(UserInputEvent.MoveLeft)) { if (activeEvents.get(UserInputEvent.MoveLeft)) {
this.move(-speedMultiplier, 0); this.move(-moveAmount, 0);
haveMove = true; haveMove = true;
direction = PlayerAnimationNames.WalkLeft; direction = PlayerAnimationNames.WalkLeft;
} }
if (activeEvents.get(UserInputEvent.MoveDown)) { if (activeEvents.get(UserInputEvent.MoveDown)) {
this.move(0, speedMultiplier); this.move(0, moveAmount);
haveMove = true; haveMove = true;
direction = PlayerAnimationNames.WalkDown; direction = PlayerAnimationNames.WalkDown;
} }
if (activeEvents.get(UserInputEvent.MoveRight)) { if (activeEvents.get(UserInputEvent.MoveRight)) {
this.move(speedMultiplier, 0); this.move(moveAmount, 0);
haveMove = true; haveMove = true;
direction = PlayerAnimationNames.WalkRight; direction = PlayerAnimationNames.WalkRight;
} }