umatheusg

Members
  • Content count

    4
  • Joined

  • Last visited

1 Follower

About umatheusg

  • Rank
    Newbie
  1. Maximising game viewport?

    Hello, Tilde, thanks for the response! I added this to my game's css and it did nothing at first. I realized that what was not letting me get rid of the margin was Visual Studio, when I started the project using F5 (I'm using TypeScript). If I run it directly via default.htm or index.html (I'm not really sure if I should be using default.htm, which is what the TS project template from VS comes with, so I made an index.html with the same content), this is what I get: Great. Exactly what I wanted. Until I resize the window. What bugs me is that the game will resize horizontally, but no vertically. I have to refresh the page for the game to "refresh". I have nothing in my update() to refresh it though, so maybe I'm missing something? Another problem is that, outside VS, Phaser.AUTO won't show the sprites, only CANVAS. I'm still trying to understand what's wrong but if it persists, I'll just use CANVAS instead. This is my game code: class SimpleGame { constructor() { this.game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.CANVAS, "content", { preload: this.preload, create: this.create, update: this.update }); } game: Phaser.Game; logo: Phaser.Sprite; barracks: Barracks; camera: Phaser.Camera; zoom: number; preload() { this.game.scale.scaleMode = Phaser.ScaleManager.RESIZE; this.game.stage.smoothed = false; this.game.scale.refresh(); this.game.load.image("barracks", "data/sprites/barracks.png"); } create() { this.game.stage.backgroundColor = '#6495ed'; this.logo = this.game.add.sprite( 8, 8, "barracks"); this.logo = this.game.add.sprite(32, 8, "barracks"); this.logo = this.game.add.sprite(32, 32, "barracks"); this.zoom = 3; this.game.world.scale.setTo(this.zoom); } update() { if (this.game.input.keyboard.addKey(Phaser.Keyboard.RIGHT).justDown) { this.zoom++; this.game.world.scale.setTo(this.zoom); this.game.scale.refresh(); } if (this.game.input.keyboard.addKey(Phaser.Keyboard.LEFT).justDown) { this.zoom--; this.game.world.scale.setTo(this.zoom); this.game.scale.refresh(); } } } window.onload = () => { var game = new SimpleGame(); }; Thanks in advance! EDIT: NO_SCALE did the job. Phew! Finally! EDIT2: I also had to add this to my update(): this.game.scale.setGameSize(window.innerWidth, window.innerHeight);
  2. Maximising game viewport?

    Hello there, I've been trying to achieve what games like this do (making the game viewport fit the browser page): With Phaser but no success, my game looks like that: Using innerWidth/Height. I tried other variables but no one worked. I'm using RESIZE scaleMode. It not only doesn't fit the window (bottom) but also has a margin I can't seem to get rid of. Is there any way around this? Thanks.
  3. Desktop HTML5 games publishers

    Oh, thank you very much, I appreciate that! That's another thing I'd like to ask. Should I add ads to the game myself? Because I don't think it'd work well for a RTS, unless they showed up in the mission select scene. I've seen some html5 games with no in-game ads at all and I'd like to do the same. Well, I haven't made the missions yet, but it will probably take 10-20 minutes to finish them. If things are going too fast, I could just reduce units speed and work rate. Even though the missions are not very long, I do plan to let the players save the game while in a mission. Offline, though. The save file would rest in your AppData. I haven't ever thought of this. Maybe quicker and harder missions, and not being able to save while playing would be an interesting approach. Btw, I'm trying to get it to work in mobile devices but it's very hard to get it to work properly (not the controls, but resolution and scaling). Thank you very much for the input!
  4. Desktop HTML5 games publishers

    Hello there! I'm an aspiring HTML5 games developer and I'm currently working on a single-player RTS for desktops. The only publisher out there that I know that'd buy games like that is Armor Games. There will be probably about 7 missions, involving getting resources, defending from enemy waves, exploring, trading and attacking enemy tribes. Looks like that so far: https://i.imgur.com/2x7mOzS.gif --- I'd like to know from you, more experienced developers, if that could get some love from publishers and if there's any other publisher looking for desktop games. I couldn't find anyone. Also, I see that most games have vector graphics and another game of mine got rejected by a publisher because they wanted games with "high quality graphics". I'm not really sure if that was a problem for them, they just sent a list of things they were looking for in a game and it was an item. So, do you think I can stick with what I can do or just hire someone to make swf sprites? Thanks in advance!