Commit Graph

153 Commits

Author SHA1 Message Date
David Négrier
c739037bc4 Camera was not properly closed in EnableCameraScene 2020-08-31 14:54:52 +02:00
David Négrier
24fb605f50 Switching to definitely assigned parameters
This allows us to go in "full strict mode" (yeah!)
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#strict-class-initialization
2020-08-07 23:39:06 +02:00
David Négrier
bc929615d1 Fixing problem when switching scenes with container 2020-07-29 11:42:18 +02:00
David Négrier
84529d6e99 Propagating customized sprites all over the game 2020-07-28 17:45:55 +02:00
David Négrier
6d0bccc0e1 Making a nice "customize" button 2020-07-28 15:53:44 +02:00
David Perez
21d2a7939b custome characters 2020-07-28 11:24:34 +02:00
David Négrier
e3e7b92c6a Fixing errors when arrows touched and no cam 2020-06-25 10:43:42 +02:00
David Négrier
371b4f0063 Fixing Firefox compatibility by remove references to InputDeviceInfo 2020-06-25 09:28:00 +02:00
David Négrier
a52b1f612b Reorganizing on x axis too. 2020-06-24 18:09:59 +02:00
David Négrier
b3c18702bb Adding borders, centering camera, fixing small bug on resize when no camera is enabled 2020-06-24 17:49:38 +02:00
David Négrier
253108eba0 - Making the EnableCameraScene responsive
- Enabling click on arrows
2020-06-24 17:29:23 +02:00
David Négrier
3de37bafed Adding a scene to configure the webcam 2020-06-24 15:35:07 +02:00
David Négrier
d785a8a1bf Refactoring connection to be part of a GameScene
Most of the refactoring issues we are seeing are probably due to the fact that we are trying to manipulate a ScenePlugin out of a Scene (the GameManager is not a Scene and holds a reference to a ScenePlugin coming from a Scene that might get invalidated by Phaser 3).
Furthermore, if we want in the future to be able to scale, scenes could be hosted on different servers. Therefore, it makes no sense to have one connexion for the whole application.
Instead, we should have one connexion for each scene.
2020-06-22 11:58:07 +02:00
David Négrier
e2be99490b Finishing removing any reference to "any" in the front. 2020-06-19 16:36:40 +02:00
David Négrier
8348d13bfe Fixing use const instead of let 2020-06-19 14:30:34 +02:00
David Négrier
db3ef81842 Adding the ability to add several entry points
We can now have several start layers and choose an entry point using a # in the URL
2020-06-07 13:23:32 +02:00
David Négrier
b82b13e351 Finalizing strict mode fixes 2020-06-04 18:56:59 +02:00
David Négrier
6f69a62d4d More strict fixes 2020-06-04 18:56:59 +02:00
David Négrier
a231024502 Fixing strict type checks 2020-06-04 18:56:22 +02:00
David Négrier
2dc682ea72 Fixing warning on character selection 2020-06-02 15:57:11 +02:00
David Négrier
f69f99f449 Adding localStorage for selected user 2020-05-26 22:26:50 +02:00
David Négrier
52e3b47cc1 Storing user name in local storage 2020-05-26 22:17:00 +02:00
David Négrier
04a1f90ed5 Adding communication between LoginScene and SelectCharacterScene 2020-05-26 17:25:29 +02:00
David Négrier
5806e379c8 Fixing selection on keyboard after selection using mouse 2020-05-26 17:02:04 +02:00
David Négrier
da0d9fed87 Adding a new SelectCharacterScene
Taking what was done in the LoginScene regarding character selection and putting it in its own scene.
Also, making character selection possible via the keyboard.
2020-05-25 23:26:27 +02:00
David Négrier
1fa39b0781 Fixing typos.
Replaced connexion with connection and LogincScene with LoginScene
2020-05-24 23:14:12 +02:00
David Négrier
cd586a9e0c Renaming /maps to /start-map
Closes #90
2020-05-24 22:53:10 +02:00
David Négrier
2448fef53a Adding a notion of instances per mapAdding a notion of instances to room
The URL signature becomes:

https://workadventu.re/_/[instance]/[path_to_map.json]

This allows us to create many instances of the same map (and therefore to create several different worlds for different people)

An exit on a map can target another "instance" by passing the "exitInstance" property.
2020-05-23 17:45:49 +02:00
David Négrier
125a4d11af Refactored and optimized messages
Now, when a user moves, only his/her position is sent back to the other users. The position of all users is not sent each time.

The messages sent to the browser are now:

- the list of all users as a return to the join_room event (you can send responses to events in socket.io)
- a "join_room" event sent when a new user joins the room
- a "user_moved" event when a user moved
- a "user_left" event when a user left the room

The GameScene tracks all these events and reacts accordingly.

Also, I made a number of refactoring in the classes and removed the GameSceneInterface that was useless (it was implemented by the LogincScene for no reason at all)
2020-05-19 19:11:12 +02:00
David Négrier
4de552437d Completely getting rid of "userid"
Previously, userid was generated by the "/login" route and passed along.
This commit completely removes the uuid "userid" (and disables the LoginController too and any Jwt check).

"userid" is replaced by the "socket id" of the connection.
So a user is now identified using a socket id, which is unique for a given connection.
2020-05-14 23:20:43 +02:00
gparant
ec297e3912 Auto-reconnect 2020-05-13 20:22:42 +02:00
David Négrier
faadacddb6 Redirecting to the correct map after login screen based on URL provided 2020-05-13 00:06:58 +02:00
David Négrier
9417e4a4d2 Refactoring/centralizing map loading in GameManager 2020-05-12 22:38:44 +02:00
gparant
f4af824cf9 Fix error mapping refresh in back & the end of this feature development 2020-05-10 23:49:08 +02:00
gparant
58b65030bd Fix feedback @moufmouf strategy of maps managing by back. 2020-05-10 18:34:55 +02:00
gparant
69777ad1cb Remove middleware to secure access API. 2020-05-10 17:31:27 +02:00
gparant
27c6034661 Manage multi scene
- Create position and check if user is in position to switch in the next scene.
 - When scene is load, we load all scene in the layer of name "exit".
 - Layer "exit" of map.json have a parametter "exitSceneKey" to identify next scene.
 - Add layer "start", the player could start in the scene on the object present in the layer of name "start".
2020-05-09 21:28:50 +02:00
gparant
fb8d9bf9a8 Multi Scene in back end
- Change maps url to get maps
 - Change GameScene to create scene with file since back end
 - Change LoginScene to upload scene and start game
2020-05-09 19:41:21 +02:00
gparant
4157a12f5d Update name map
- Change name in game scene and login scene
2020-05-09 16:47:55 +02:00
gparant
3ec167ee44 Merge branch 'master' into feature/login-page
# Conflicts:
#	front/src/Phaser/Game/GameScene.ts
#	front/src/Phaser/Login/LogincScene.ts
2020-05-06 02:20:28 +02:00
gparant
5a6415607d Send event and play animation with user frame 2020-05-06 01:50:01 +02:00
David Négrier
ad3484285b Fixing Cypress tests 2020-05-04 18:38:04 +02:00
gparant
58a1a8a3c9 Add select player in login page 2020-05-04 01:48:14 +02:00
David Négrier
b260dc32b5 Merge from master 2020-05-03 18:04:01 +02:00
David Négrier
5601e5e134 Adding login method back for future use in LogincScene 2020-05-03 15:18:15 +02:00
gparant
fdb40ec3e2 Fix webrtc multi 2020-05-02 20:46:02 +02:00
David Négrier
d72741ce0c Fixing linting 2020-05-01 23:48:30 +02:00
David Négrier
42ddd8b858 Changed font from text
Input name can only be 4 characters long
Passing name to next scene
2020-05-01 23:19:51 +02:00
David Négrier
85f84517f6 Adding logo in the bottom right corner and placing help text in function of height 2020-05-01 22:23:41 +02:00
kharhamel
62d2498e34 remove the GameSceneInterface from LoginScene 2020-04-30 19:18:35 +02:00
gparant
4e556782af Fix integration login scene in game manager 2020-04-29 00:01:37 +02:00
kharhamel
25ac579a90 prettier login page 2020-04-26 18:48:41 +02:00
kharhamel
d691b58d0b basic login page with a text input and a click button 2020-04-26 17:54:56 +02:00