-
Posts
25 -
Joined
-
Last visited
Profile Information
-
Gender
Male
-
Interests
JS
Contact Methods
-
Twitter
carlosnufe
Recent Profile Visitors
821 profile views
carlosnufe's Achievements
Newbie (1/14)
8
Reputation
-
The_dude8080 reacted to a post in a topic: Phaser sockets multiplayer
-
In update() method usually is developed stuff about physics, collisions, player movement and so on. You update information regarding fps. Socket callback has a close behaviour but with the difference that you will throw your own "update function" which it should not the phaser update. You can use a function to handle player positions, for example, passing n parameters and do some stuff. This function could be used in update phaser function and socket callback. As I said, it's Javascript itself. Hope help you.
-
Hi again ;), No, you should not, if you look at their doc you'll find how to subscribe to server events. For instance, var socket = io('http://hostname'); socket.on('nameEvent', function (data) { console.log(data); }); Try to understand how it works, it's Javascript itself.
-
Normal case is when server broadcasts and the clients are subscribed and ready for listening whatever event thrown. Then, on client side that events are handled
-
Just @ionprodan. Look at your code, when a key is pressed you are setting the velocity but when you release don't anything. Nothing Magic happens, just it need to set again the velocity.
-
@BdR Sorry about that, I was listing the main classes, Grid x 3 was for GridView.js, GridController,.js GridModel.js . This is an example, you can name as you want, ofc. Apply MVC pattern to a Phaser game is easy, in fact, in any project ( at least, for me ). You must have a controller file that is instantiated in main Phaser game state, could be a 'Play' state, after 'Menu', 'Tutorial' or 'LevelSelection' state ( it does not matter ). Controller, in turn, instance view and model. At this point you must develop all the game logical part in this file. You will control your game by model class and will move your view elements accordingly to the model data. Can use browserify, webpack, rollup and so on, to load your files into anothers, I do not know if you use it, but you should in high percentage, it depends of how you will develop your game.
-
Hi @BdR, If you do not use Phaser Physics I think that it is the best way, even though maybe it's easier and faster with physics. I mean, you will have the whole grid control separating and using the mvc pattern. Well into my mind is how I'd do it. So, for main classes: - Snake, Gorup ( each one as you said ) - Collectable item ( food, mushroom..whatever ), Sprite - Wall, Group - Grid x 3, View, Controller and Model The advantage of this composition is that you can change the game and it will work as well, for instance, in a game like candy crush, tetris, battleship, and so on..
-
Welcome @pikosan, could you do a simple test ? Try to change the stage color background , if you are succesful, so, change the html background color.
-
Follow me on twitter, we will talk in private to solve this issue.
-
Maybe, image aspect ratio is not equal to the device aspect ratio ?
-
Hi MrWillyFox, Nobody won't help you whether no code is shown. The reader can not guess how you wrote the code, it could be different reasons. Maybe the asset of cannon is not at right angle, maybe..maybe.. There may be many possibilities.
-
erich reacted to a post in a topic: looping problem when player hits on enemy
-
erich reacted to a post in a topic: looping problem when player hits on enemy
-
You are welcome.
-
I did not understand the flag 'this.collisionHasOcurred'. When your youLose() method is called you should implement some time of delay because update is calling your method too fast and even though you put this flag the code is executed faster than you know. Try to deactivate the enemy for a while.
-
alessandronunes reacted to a post in a topic: Sprite Group Immovable Fail
-
I've done this simple example for you, it works with my above code. https://jsfiddle.net/carlosnufe/jfmtt3sx/ As @alessandronunes and I said, just, remove code, not delete, just comment and you will find the mistake. It is not a hard game behaviour but you are putting more code than required I think. I hope you solve your issues. TIP: to get better developer go to the simplest case and climb up, commiting ( git ) among differnet behaviour.
-
alessandronunes reacted to a post in a topic: Sprite Group Immovable Fail
-
mariante reacted to a post in a topic: Phaser + Bluetooth > Possible?
-
Yes, why not, but you are missing the backend. Not backend to handle bluetooth = it does not work. Only front end it is not possible, there is not API to this purpose.