Larkenx / Rotten-Soup

A roguelike built with Vue, Vuetify, Tiled, rot.js, and PixiJS! Playable at https://rottensoup.herokuapp.com/
GNU General Public License v3.0
379 stars 54 forks source link

Is compatible with mobile devices? #78

Open jrichardsz opened 3 years ago

jrichardsz commented 3 years ago

I opened on my mobile and I got these problems:

Is it possible to make some javascript changes to enable mobile compatibility? If someone shows me the right way, I think I can do it!

Thanks

Larkenx commented 3 years ago

Hey there, I’ve never tried to make it compatible with mobile but it’s a fun idea :)

jrichardsz commented 3 years ago

Yes, very fun :D

In which part can I start?

Larkenx commented 3 years ago

So I haven’t touched this project in quite some time and it’s not by any means an exemplary project as an FYI. Just something fun I did in college :)

The player event handlers are all in Player.js here https://github.com/Larkenx/Rotten-Soup/blob/master/src/assets/js/game/entities/actors/Player.js and use ROT.js as a convenient enum for the key codes. You could try and add mobile events here somehow

Larkenx commented 3 years ago

https://github.com/Larkenx/Rotten-Soup/blob/master/src/assets/js/game/entities/actors/Player.js Event handling is done here. Event handlers are added and removed before and after a player makes a move or “acts”. you could add some mobile event listening code there I think but I’ve never done anything like that before.

alternatively could try writing a little “controller” Vue component in the UI code that triggers player events somehow but that sounds tricky too

Larkenx commented 3 years ago

lastly the code for resizing the game screen is probably really not mobile friendly and would have to be extensively refactored