• Content Count

  • Joined

  • Last visited

Everything posted by HappinessSam

  1. HappinessSam

    Spine performance

    It's still there, though nowhere near as bad - depending on the number of spine it's maybe half a second at most and usually just a quick stop stutter.
  2. HappinessSam

    Spine performance

    I hope it's ok me piggybacking this thread for another, probably unrelated spine performance issue rather than starting another thread. The project I'm working on has a lot of spine animation and also can have a very large canvas. I'm finding that if I have the game running then switch to another tab and wait more than 4-5 seconds, when I switch back to the project it freezes for a few seconds with the permorance analyser showing it being s. I have every spine with autoUpdate set to false and I have found that if I cap the delta time that can be passed into update it helps, but if with that there is still a noticable stutter. To clarify, my update function looks something like this: this.lastTime = this.lastTime || Date.now(); var timeDelta = (Date.now() - this.lastTime) * 0.001; this.lastTime = Date.now(); if(timeDelta>0.1){ timeDelta = 0.01; } spine.update(timeDelta); Is this something anyone else has seen and is there anything that can be done to help?
  3. HappinessSam

    Pixi Spine runtime error

    I'm trying to use some spine animations in a large Pixi application at work. It's mostly working but I'm getting intermittent runtime errors coming from the Spine objects. This error is:Uncaught TypeError: Cannot read property 'transform' of null at Spine.e.updateTransform (pixi.min.js:formatted:4401) at Spine.autoUpdateTransform (Spine.ts:479) at e.updateTransform (pixi.min.js:formatted:4405) at e.updateTransform (pixi.min.js:formatted:4405) at GameScene.e.updateTransform (pixi.min.js:formatted:4405) at e.render (pixi.min.js:formatted:8605) at Function.ScenesManager.loop (ScenesManager.ts:273) at t.emit (pixi.min.js:formatted:13126) at t.update (pixi.min.js:formatted:13068) at _tick (pixi.min.js:formatted:12988) The error is coming from PIXI.Container, line 323 because this.parent is null. This is a bit bonkers because this is only being called because the spine object is in the children list of the scene being rendered. this.transform.updateTransform(this.parent.transform); I dug in a tried to isolate the problem and found that somewhere in the Spine update function the parent was being set to null. In Chrome debugger I put in some conditional breakpoints for dt>0 && this.parent==null and found that the culprit was line 184 this.state.apply(this.skeleton); Before this line the breakpoint doesn't trigger, after it it does, with this.parent being null. I had a read through AnimationState.apply and I can't for the life of me see anything that would be setting the Spine parent state. So my question is can anybody else see anything in there that might be creating this effect? I should say that the application does a bunch of complicated pooling of symbols, so the Spine object might be getting removed and sent back to the pool then re-added frequently. But my understanding was that since JS is mostly single threaded if this.parent exists on line183 but not 185 something between there must be setting it to null. I'm not extending or doing anything else to the Spine object. Unfortunately I can't give out any coded to show the context. I'd be really grateful if anybody has any suggestions or input.
  4. HappinessSam

    Pixi Spine runtime error

    This has worked fine and touch wood is working perfectly now. I was also getting an occasional flickering issue which has cleared up after setting the spine's autoupdate to false and updating manually - maybe this apporach would fix https://github.com/pixijs/pixi.js/issues/4117 too.
  5. HappinessSam

    Pixi Spine runtime error

    Thanks! That's great info. I think I will look into manually call update, as that looks safer.
  6. You really got me there for a minute. Kudos!
  7. HappinessSam

    Dungeon Slog - roguelite action rpg

    Quick update that there is now a playable web version on Armor games http://armorgames.com/dungeon-slog-game/18110
  8. HappinessSam

    Dungeon Slog - roguelite action rpg

    I've just release my new game one the play store! The game is Dungeon Slog. It's an action/arcade rpg with roguelike elements. In it you need to fight your way through a randomly generated dungeon of monsters, levelling up, buying items and choosing which member of your party is best suited to the current challenge. It was programmed in vanilla javascript using Phaser as the game engine. I used l10n for the localisation (even though I have yet to actually localise it into another language) and Apache Cordova to package it as an app. I used the Oryx tileset with additional icons bought from Gamedev market. The music is by Eric Taylors, sound effects by Kenney Feedback, questions, bugs or suggestions more than welcome. Gameplay trailer: Screenshots:
  9. HappinessSam

    Viking: Way to Valhalla

    Really nice game and I'm impressed that you managed to make it in 1.5 months. All my 5s are yours. I agree that the tutorial is a bit rough around the edges but it's simple enough to work it out that I think you can get away with it.
  10. HappinessSam

    Seven Deadly Seas

    I love the visuals. I have to confess that I only payed one game but I like the core gameplay. Are there waves or do you just play until you die? If there are waves and I just didn't reach the end of one then I'd say it could use some indication of how much you have to go. If you don't have waves I would think about putting them in. By waves, I mean that there are a certain amount of enemies you have to kill or survive, then you get some kind of reward and a breather, then it starts again at a higher difficulty. I think it's something it would really benefit from.
  11. HappinessSam

    Cordova reward videos

    I have a Phaser game that I'm packaging with Cordova. I've been using this admob plugin for insterstials but I decided I wanted to add some reward videos since I've heard they#re really good. In theory that plugin should be able to serve them but I can't get them to work. I thought the problem might be with my mediation so I tried a couple of other plugins that serve the videos directly (admob doesn't serve reward videos itself), like this vungle one and this UntyAds one. I can't get any of them to work, even if I build them in a clean, empty project. I suspect that I have something wrong with my ads setup but I just wanted to ask if there is anyone here who has managed to get them to work and if there are any gotchas I need to look out for.
  12. HappinessSam

    [WIP] Orange Sea - my first game

    It looks beautiful. I found that on desktop the controls are a bit wonky for me - they just don't feel responsive enough for my taste. You accelerate slowly then suddenly shoot off. In terms of performance it was mostly OK but I noticed some slowdown when the lightning flashed. On mobile I think I actually preferred the gameplay. I think it's because I'm more used to and tolerant of controls being difficult in mobile games. I noticed it was missing the bottom part of the screen - try adding this.scale.windowConstraints.bottom = 'visual'; before you set the scaleMode when it's mobile and see if it fixes it.
  13. HappinessSam

    Trouble drawing a complex image in Phaser

    Try changing it to bmd.setPixel(location.x, location.y, 255, 0, 0, false); in the main loop then at the end call the correct value for the last pixel. The false is the flag for whether to update the image context immediately and it defaults to true. This mean it's calling this.context.putImageData thousands of times, hence very slow. If you only call it at the end it should be much faster. I checked the Bitmapdata source and I couldn't see a proper function to call this.context.putImageData, hence calling setPixel with immediate true so it updates the image. There is probably a better, correct way to do this, but it's a bit late and I need to head to bed.
  14. HappinessSam

    Trouble drawing a complex image in Phaser

    Just to check, when you were trying to use bitmapData did you try just using setPixel? That would seem the most straightforward method if each square is represented by a single pixel. How big would the image need to be, because even a massive image, say 2048x2048 setting every pixel individually with rect shouldn't be taking 20 minutes.
  15. HappinessSam

    Pixi on Galaxy tab 2 webgl renderer

    I've been trying to get my Phaser game to work on my old Galaxy tab 2 but it's been throwing errors from the pixi renderer in Phaser. At first I thought it might be that the phaser version of pixi is outdated (I found this issue on the pixi github) but I'm getting the same errors when testing bunnymarks on the pixi site. Does anyone else have any experience of this and/or advice on workarounds? It works if I force it to canvas rendering but this really impacts the performance - I don't want to have to cripple it for everyone because of an issue on a few tablets. The error says 'WebGL: INVALID_VALUE: disableVertexAttribArray: index out of range' and '[.CommandBufferContext]RENDER WARNING: there is no texture bound to the unit 0'. My tablet is on android 4.2.2 with chrome 50.0.2661.89
  16. HappinessSam

    Make rectangle/polygon or any graphics object clickable?

    To make a Phaser.Graphics clickable, set inputEnabled to true then ass a listener + context to it's events.onInputUp handler. If you want the cursor hand set it's input.useHandCursor to true. There is no hitArea as far as I know, it just uses the dimensions of the image. That post may have been thinking about the body hit area that is used for physics - this you can change. So something like this should create a red square which is clickable and show the hand when you roll over it. (not actually tested in a game but I think it should work) var graphics = game.add.graphics(0, 0); graphics.beginFill(0xFF0000); graphics.drawRect(0, 0, 100, 100); graphics.inputEnabled = true; graphics.input.useHandCursor = true; graphics.events.onInputUp.add(onClick, this); function onClick(target, pointer){ console.log("hooray"); }
  17. HappinessSam

    Phaser full screen mobile + Cordova

    I have been building a game, using the Phaser full screen mobile template as my starting block. My intention was to create a game that could have a web version but that could also be packaged as an app by using Cordova. So far it's been going well and I'm reasonably close to an alpha release and it works fine on desktop but I've been having trouble getting the scaling right on mobile. I've package the game in Cordova as a full screen app but the game seems to initally be getting fed incorrect information about the dimension of the screen, leading to the bottom the height being too large cutting off the bottom. I have tried forcing the player to enter full screen and this works (I should stress that the app is already a full screen app, I am just using game.scale.startFullScreen to make it use the fullscreen API), but if the user clicks hits the hardware back button they exits fullscreen and the game is again cut off. Yes, I have prevented the default backbutton action but it still seems to exit fullscreen. At the moment my workaround is to have the game catch the fullscreen exit and pause the game to the user can click to reenter full screen but I don't think this is a good experience and I feel I must be missing something or doing something wrong. Is there a way to change the settings so that the sizes are consistent and correct and it shows the whole phaser game canvas all the time, whether in fullscreen or not? To show what I mean I have created this project: http://utterlysuperb.com/dev/js/fsm/. All it is is the full screen mobile template with a background image that takes up the whole game and a button to toggle between fullscreen and a console.log of the width+height when resize is triggered. On desktop it's fine, but if I view it on mobile, whether through inspecting chrome or using the mobile dev tools to spoof a mobile it cuts off the bottom and requires scrolling when not in fullscreen. This is also the case if it is wrapped up in Cordova.
  18. HappinessSam

    Tools to create audiosprites?

    I've been trying to use this tool to create some audiosprite files but I'm having some issues. I think I have everything installed correctly and the bat file I created, based on the one above works: audiosprite --output sfx --export mp3,ogg,m4a,wav --format createjs --bitrate 64 --samplerate 44100 --channels 1 creature1.ogg creature2.ogg creature3.ogg I have quite a lot of sounds that I want to use and it's getting a bit unwieldy so I've been trying to use the javascript method based on the API usage example on the github, so var audiosprite = require('audiosprite') var files = ['creature1.ogg', 'creature2.ogg', 'creature3.ogg'] var opts = {output: 'result', export:'mp3,ogg,m4a,wav'} audiosprite(files, opts, function(err, obj) { if (err) return console.error(err) console.log(JSON.stringify(obj, null, 2)) }) but I'm getting errors: error: Error: Error adding file at C:\Users\Sam\AppData\Roaming\npm\node_modules\audiosprite\audiosprite.js:267:25 The source files, js file with the above code and the bat file are all in the same folder. I have also tried specifying the full path in the files array, but no dice. I could just keep using the bat file but I'd really prefer to work out what I am doing wrong. I feel a bit silly asking a question in a year old thread but this seems to be one of the few places discussing how to use it.
  19. HappinessSam

    Displaying fullscreen on mobile

    It turns out it's just that I'm an idiot (or just too sleep deprived and rushed to do good work) and I had a typo in the mobile side of the init function. It's working now, though I still need to fiddle to get the scaling right. Sorry and thanks for trying to help.
  20. HappinessSam

    Displaying fullscreen on mobile

    I've been trying to build a simple test game built on the full screen mobile template. I've got it to the point where it's buggy and incomplete but playable and I've only just uploaded it and tested it on my phone. It works fine on desktop but on my phone (a onePlus 2) using chrome it doesn't display. If I select request desktop site it does show up, but then of course it has the desktop setting and so it doesn't scale properly. Is this something anyone has come across? My game is here.
  21. HappinessSam

    Displaying fullscreen on mobile

    Thanks, but I need me Game to be 600x400. It's the display that needs to scale. I haven't had time to look under the hood to see how Phaser deals with scaling the game display.
  22. Hi, new to the forum. Also new to javascript, typescript and visual studio. What I am is a fairly experienced AS3 dev who's giving in a finally trying some javascript. It was suggested I try TS and use it to ease my way into JS, learning from the JS visual studio spits out. It's going ok, but I keep on feeling like I'm missing something, and probably the code I'm producing is fairly wonky. I have a few questions I'm hoping you guys can help with. they're probably obvious if you know what you're doing. I did do some searching but all the examples and tutorials I've found only use one TS file and my problems are with working with many. - I'm used to coding with lots classes, but visual studio spits out everything as separate js files. Does it have a way to pull these together into one big js file or do I need to use another programme. I assumed this is something I should do - I don't fancy having a simple game that needs 50 different js files included. It's also a hassle having to keep updating the default.htm by hand to add new files in. There must be a way to automate this? - Is there anyway to add resource/class paths like in Flash builder or Flashdevelop? I can't work out how to do it in VS so I've been adding everything into my source folders, but again, surely there's a better way? - Are modules worth it? I pretty much ignored them initially, then I used Rich's convert tool to convert over some AS3 stuff and it used them as standard so assume they're best practise? - Talking of modules, I was looking at the js code generated and it seems so bloated. module com.utterlySuperb.nineBall.engine { export class Game { constructor(public stage: any) { var gameState: GameState = GameState.getInstance(); gameState.reset(); } }}gives you var com;(function (com) { (function (utterlySuperb) { (function (nineBall) { ///<reference path='../model/GameState.ts'/> (function (engine) { var Game = (function () { function Game(stage) { this.stage = stage; var gameState = GameState.getInstance(); gameState.reset(); } return Game; })(); engine.Game = Game; })(nineBall.engine || (nineBall.engine = {})); var engine = nineBall.engine; })(utterlySuperb.nineBall || (utterlySuperb.nineBall = {})); var nineBall = utterlySuperb.nineBall; })(com.utterlySuperb || (com.utterlySuperb = {})); var utterlySuperb = com.utterlySuperb;})(com || (com = {}));Which seems mental. Am I just structuring it wrong - should I not being using so many levels? Or are modules just not appropriate for this kind of small projects? Anyway, thanks. I probably have another bazillion questions, but these are the one that are bugging me and that I can't really google the answers to.
  23. HappinessSam

    Resizing a game in Safari

    I've been trying to sell my first html5 game and I've had a few bites, but they've come back to me saying that it doesn't resize on orientation change correctly when viewed in Safari on iOS. The game has almost square dimension (476x500) so I've tried to code it so that it's just as happy landscape as portrait and simply resizes when the user turns the phone. It works fine on Android and it initially resizes correctly on Safari, but when the user turns their phone it goes a bit haywire. I've been googling and trying different things but I still can't get it to work properly. I'm really hoping I've done something obviously wrong and stupid that someone here can point out. The actual game can be found here Here's a test to make sure the function and values were there correctly. Here's my code (I do have the function.bind workaround so I know it's not that). //Relevant html//-----------------------------------------------------------------------//<head> <meta name="viewport" content="user-scalable=0, width=device-width, height=device-height" /> <meta name="apple-mobile-web-app-capable" content="yes" /></head><body> <div id="content"> <canvas id="gameCanvas" width="476" height="500"></canvas> </div></body> //Base CSS//-----------------------------------------------------------------------//body{ background-color: #1a1a22; margin:0; padding:0;} #content { position: absolute; width: 100%; height: 100%; } #gameCanvas {} //Resize code//-----------------------------------------------------------------------//Main.prototype.onResize = function () { createjs.Tween.get(this).wait(200).call(this.adjustRatio.bind(this)); //this.adjustRatio();};Main.prototype.adjustRatio = function () { var img = document.getElementById("gameCanvas"); if(window.innerHeight < window.innerWidth) { img.style.height = '100%'; img.style.width = 'auto'; var gameWidth = window.innerHeight / 500 * 476; var gameHeight = window.innerHeight; } else { img.style.width = '100%'; img.style.height = 'auto'; gameWidth = window.innerWidth; gameHeight = window.innerWidth / 476 * 500; } var content = document.getElementById("content"); content.style.left = (window.innerWidth - gameWidth) / 2 + "px";};
  24. HappinessSam

    Alley Kittens

    I have another game finished, Alley Kittens It's a reverse mine sweeper game featuring kittens built with PIXI They should hopefully work on the usual range of mobile devices so I would be much obliged if people could give them a play and tell me how they run and what they think. Ta
  25. HappinessSam


    Looks and plays beautifully in chrome on my LG p880. My only gameplay quibble is that it was a bit frustrating to have to get 8 and only have a 4 and a 1, then the next block are two -1s, then I have to wait another turn to get the blocks to get 8.