• Content count

  • Joined

  • Last visited

About Odk

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

407 profile views
  1. Not sure what would be your use case? When you publish your game "url" will be remote http server. In theory you could write a method that will send HTTP POST or PUT request to server and then server will write (if you program it to do so) the content to file. But once your game will have more than one player it will probably lead to data corruption. Better say what you want to achieve and then maybe someone will be able to point you toward proper solution.
  2. [WIP] Increstellar - conquer the galaxies

    Hi, I'm playing for almost 1h and I can say that it's quite nice. One thing for now is that there is no visual relation between ship level and fleet strength/performace. I don't get what ship upgrades give.
  3. How to attach text on enemies

    Because you do: this.zombieHealthText=this.game.add.text .... So you are assigning new text object to same game object in each iteration. In result you have reference to just one text object. It should be zombie.zombieHealthText=this.game.add.text .... Then you will create text object for each zombie separately.
  4. How to attach text on enemies

    As you already have zombies as group then I would add something like this (writing from top of my head) in your update function: this.zombies.forEachAlive(function(zombie) { zombie.zombieHealthText.x = zombie.x; zombie.zombieHealthText.y = zombie.y; }, this); Then it will update text object position in each frame. It's fairly simple operation so shouldn't be a performance issue on any device.
  5. As JS is very async lang you need to stop thinking like in other languages. Normally in most of languages you expect that in most cases line below gets executed after line above. In JS everything needs to be non blocking as it would freeze whole browser. So almost every call is async and next function doesn't wait for previous to return. It was a problem for log time but then promises arrived. Check this page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise and everything should be clear. TL;DR: Return answer from database as Promise. I think that this.avatar should be a promise to avatar object and not actual result. Then you will be able to wait for it later. EDIT: Other option is to start with generic avatar same for every player and replace image once its loaded using a callback. If your generic avatar would be blank image of same size as real avatar then it will display white square at the beginning and replace it with real image soon after.
  6. Nice idea, but IMHO ball is too fast and there is no friction. It's impossible to run to ball once it was hit. I would experiment with reducing ball speed over time. So after touch it will be like kick and it will slow down to full stop after some distance.
  7. Destroy does not remove prototype

    Is there any reason that you want to destroy fish object? Normally to reduce cost of spawning new object you create group of fish objects, set them all to dead state. When you need to spawn new fish just call: https://photonstorm.github.io/phaser-ce/Phaser.Group.html#getFirstDead set x,y coordinates, etc and make fish alive again. With this way you will only need as many fish objects as maximum you want on screen at once. Creating new sprite cost resources, try to avoid it if possible.
  8. Create start menu in Phaser.

    Hi, Just create separate state for it and put there start button. In on click function change state to your "normal" game state. Like this: http://phaser.io/examples/v2/buttons/action-on-click but change state on click. There are no special methods for creating start menus.
  9. Phaser Multiplayer problem

    Hi, This helped me to grasp fast multiplayer games: http://www.gabrielgambetta.com/fast_paced_multiplayer.html Nice read IMHO.
  10. New subforum

    Hi, TL;DR: I'm proposing new sub-forum, "Servers and back-end programming". I create small games (more proof of concept than games at the moment) at the evenings and often check this forum for inspiration and ideas. Before releasing any game I've decided to create universal back-end service for them. Some will say "why?" and "don't do this, it's hard", but I think I can manage (more on that later). It's already in nice shape. From time to time I see posts with questions about game back-ends and hosting. IMHO we should separate those into new sub-forum, so people will know where to ask them. It will be also simpler for guys like me to find them and help each other. Why I think that I'll manage to create nice and robust back-end and also help with same on forum? I'm sysadmin with 12 years of experience. Now I'm senior SRE at big financial institution with lots of clients and trades. Before this I worked as lead sysadmin/devops for mobile game company. I've maintained and helped develop back-ends serving quite big traffic (over 200M/req day). Now I try to use all that knowledge to create my own back-end but would be great to help also others. In current state I (and possibly other like me) often miss posts with such questions as I usually check forum every 2-3 days. I think that separate sub-forum would help. It should cover all topics related to: hosting, backend services, backend development. What do you think?
  11. Google play services integration with phaser

    And nothing shows up in browser console? No errors, etc? In my browser I have problem with parsing js/index.js: "Refused to execute script from <url> because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled." PS. To clarify for others play services are avail. for all devices. Only not all features are supported on every platform. You can read more at: https://developers.google.com/games/services/
  12. Hello, Maybe just join https://ancientbeast.com/ project. They are building HoMM3 like html5 game. Source code is at https://github.com/FreezingMoon/AncientBeast Working with them would allow you to gain more experience in subject and maybe at some point create your own version.
  13. If your game is static only (pure html + js + assets without any server side code) then you can use amazon S3 static hosting feature. It offers https access and you can put url to S3 on facebook app settings. Then you wouldn't need any server and you will pay only for used traffic.
  14. Create stretchable sprites with fixed parts

    Hello, I would use BitmapData for such things: http://docs.phaser.io/Phaser.BitmapData.html You will need to create function that draws your button and call it every time you need to change width.
  15. Group accelerateToObject?

    Hi, You can try with: monsters.forEachAlive(function(monster) {game.physics.arcade.accelerateToObject(monster, this.player, ARBITRARY_ACCELERATION_AMOUNT);}, this);in update function. I don't know if it's possible to accelerate whole group but: http://docs.phaser.io/Phaser.Group.html#callAll from docs looks promising, but in the end it would probably iterate all members anyway.