All Activity

This stream auto-updates     

  1. Today
  2. [edit at bottom but not completely solved to my liking] I'm probably missing something silly but i'm pretty fresh to this, i did a search for "callback on specific animationcomplete phaser" but it gets me 1346 pages, apologies but i'm just gonna ask hoping someone picks up the phone : i have one sprite named "chest" and one named "grabhand" i have a function called deathtrapcomplete() which does some camera stuff and restarts / resets the scene on gameover now i have for grabhand : this.anims.create({ key: 'traphand', frames : this.anims.generateFrameNumbers('grabhand', {start : 0, end: 29}) but for chest i have two : this.anims.create({key: 'openchest' ....etc and this.anims.create({key 'chestsaysno' ... etc i have an event for grabhand : this.grabhand.on('animationcomplete', this.deathtrapcomplete, this); which does exactly what it should, it plays the anim completely and then starts the gameover sequence, ... very tidy, lol but when i use it for chest this.chest.on('animationcomplete', this.deathtrapcomplete,this); it triggers for both "openchest" and "chestsaysno" ... which is not so good as the former is simply an empty chest with a puff of dust coming out while the latter is a chest with a deadly trap (both from the same spritesheet) So the question, how do i trigger it only for "chestsaysno" , defining two different sprites seems overkill and working around it in the call itself seems very in-elegant as the deathtrapcomplete() function is already there It's hard to imagine i cant insert the specific animationkey in the on(...) handler somewhere so my guess is i simply can't find it as im pretty much a noob, on the docs it says " event string | symbol but when i try this.chest.on('animationcomplete|chestsaysno' ... etc) it doesnt trigger anything at all (which is probably me not understanding what the pipe symbol means thats why im asking , thanks a lot if anyone has time and patience to help me out here about a minute after i find something on https://labs.phaser.io/edit.html?src=src/game objects\graphics\health bars demo.js where animation.key is used in the callback function so if i add deathtrapcomplete(animation){ if(animation.key != 'openchest'){ ...do gameover stuff.. } } it works but i still feel it would be better if i can simply define the handler to only react to the specific animation in the first place ... if anyone has any advice on the matter i would be much obliged, thanks
  3. Can I restart a scene and pass in parameters to its init() function at the same time? When I do this (changing which files are loaded by setting the init parameters), the scene seems to go blank and not show anything the second time around. [EDIT]: It turns out you can pass parameters to this.scene.restart() to the init function. Just have to be sure to mind your closure location for "this" if you do weird stuff it with by extending loader operations beyond the preload method and passing it to helper functions.
  4. Yesterday
  5. Updated both Template Projects to their latest Library versions. Babylons 4 & Three 104.0
  6. I know the idea is way older, but here it is. Measure the target amount of water using the provided measuring cups. The level has some new twists like addition of different colored liquids and a "wildcard" liquid. ;-) https://gamedistribution.com/games/water-lab Play and share your opinions.
  7. http://slicker.me/javascript/mine/minesweeper.htm
  8. b10b

    Game worlds creation

    @Reyel1980 "Lords of the Realm III" by Impressions Games.
  9. Last week
  10. A little project to lern make a multiplayer game https://diogo-nullmoon.itch.io/pong-ol-4d
  11. Does this help? https://www.pixiplayground.com/#/edit/sNKLacqLJenYpsQyc6mIp The issue you were struggling with is that Text is lazily updated. It only usally gets updated when it gets rendered; but you can force it to update with the updateText() function.
  12. Hello, I'm trying to optimise at bit my text rendering. I render a graph, and each node in it contains an icon (from fontawesome or similar type font) and the link connecting it can display the relation name. There is only 9 possible icons and 13 relations so it seems like a bad idea to generate 'N' PIXI.Text objects so I thought I'd try just caching the text object in a map and using its texture inside sprites then cleaning up when done. I've ran into two problems though. First the texture wont display unless the text is part of the scene. If I add it as a child the Sprites will work. If I don't they will just be empty. Secondly, if I try to work around problem one by adding the text into the scene anyway the Sprite versions will all flicker when the text is changed (I change the text on a zoom event to scale it sharply) and not appear for a starting frame when the text is added. Is there a way to generate the texture for a text item without adding it to the scene, and could that fix the flicker? I forked someone elses pen to try demonstrate the text being part of the scene issue. https://codepen.io/anon/pen/yWXMJM I did see this project - https://github.com/JiDW/pixi-cocoontext/blob/master/src/CocoonText/index.js But I was hoping not to have to copy all the inners of Text Cheers Bob
  13. Thank you icp. Will take a look at Playcanvas with your counsel in mind. Anyways I dont have much faith in me as I'm under-noob. I get lost easily and so and so. More artistic mind I guess.
  14. A running playground that reproduces this problem would be really helpful for trying to track down what is going on here. You can choose the pixi version using the "settings" button to get your exact version.
  15. There's that thing like "TRACK" . You have to pass track number and decide whether you ADD animation just after current one will end ( no end for looping) or SET it. I advice you to read esotericSoftware forums and look up their examples. Animation is the same here and in other engines that support spine.
  16. I did try to understand it but I didn't really get it and what I am trying to do is to play different animation on a keyboard button press example : w = walk forward animation , s = walk backward animation, etc.. I can play animation in one direction and this is without the pixi-spine.js
  17. Wait.. you its not constructor problem. Did you pass something that is not "undefined" ,"null", did you pass just an object without "defaultAnchor" property?
  18. Congratulations! You've found a real bug. We have EMPTY as default param, but because of the bug it actually crashes, yeah, defaultAnchor.
  19. I found the problem. The problem is that my loader loads textures and calls the callback function to create sprites long after the scene has loaded. And here I face problems - if I am creating a sprite from the loaded texture - I get an "Uncaught TypeError: Cannot read property 'x' of undefined" (it does not have defaultAnchor property). I've found out that I need to set empty texture first, like this: this.item = new Sprite(Texture.EMPTY); this.addChildAt(this.item, 0); and then, if I try to set the loaded texture: this.item.texture = this.settings.textures.c_fillT_S.texture; It does set the texture, but as a result BatchRenderer elements array has plenty of "null" items and if try to render that thing - I get the following errors: Uncaught TypeError: Cannot read property '0' of null at BatchRenderer.packGeometry (core.es.js:11542) Uncaught TypeError: Cannot read property '_texture' of null at BatchRenderer.flush (core.es.js:11398)
  20. I am making a 2d cross country horse riding game. The player will be able to move left and right and jump obstacles. I use tiled to make the obstacle course. I want to use matter physics because I needed detailed obstacles rather than just simple shapes. I have also used collisions because I could not find any other way to define whether a user has hit an obstacle on a tile layer. As I am not using collision physics (game over when I hit a obstacle) maybe there is a way better way of doing this game. Here is how I set up the collision: const road = this.make.tilemap({key:"map"}); const roadTileset = road.addTilesetImage("terrain", "tiles"); const belowLayer = road.createStaticLayer("bot", roadTileset, 0, 0); const collisionLayer = road.createStaticLayer("collision", roadTileset, 0, 0); const treeLayer = road.createStaticLayer("tree", roadTileset, 0, 0); //const topLayer = map.createStaticLayer("top", tileset, 0, 0); //collisionLayer.setCollisionByProperty({ collides: true }); collisionLayer.setCollisionByProperty({ collides: true }); this.matter.world.convertTilemapLayer(collisionLayer); this.matter.world.createDebugGraphic(); player physics set up as follows: player = this.matter.add.sprite(400,6300, "player").setOrigin(.5, .5); player.setBody({ type: 'circle', radius: 6 }); I am now trying to get the player to jump over barriers with collides property, I was hoping to do so by pausing the collides property for half a second or so to allow the player to move through when the jump button is pressed, but this is proving more difficult than anticipated.
  21. Reyel1980

    Game worlds creation

    please name this game
  22. that's interesting, I gave the link to guys in the know
  23. Hi Ivan, thanks for your reply! I have been debugging (extensively) and it seems the error was caused by some odd state of package-lock.json of npm, or some strange dependency issue. Deleting that file (also did for yarn.lock), plus all the modules, and starting from scratch to install all the dependencies seemed to make the trick. I did not even think of this option, but after your message saying that it should all work fine, I created some basic test with a new fresh project and I realized everything was just working fine. Perhaps this post can help anyone who bumps into a similar problem. Thanks again and sorry for the mess!
  24. for example we are loding this PNG file in base64: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////9zeKVjAAAAAnRSTlMAz31IEhkAAAAQSURBVHgBY0AGjExAgokJAAAtAAiPjSHbAAAAAElFTkSuQmCC while debugging I noticed that it goes into prepareUrl method which splits the dataURI into two parts: directory: "image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////" file: "9zeKVjAAAAAnRSTlMAz31IEhkAAAAQSURBVHgBY0AGjExAgokJAAAtAAiPjSHbAAAAAElFTkSuQmCC" we used Texture.from("data:image/png;base64,..."); before and it worked fine. It's strange, but when pasting this dataUri in pixi playground - it works just fine, so the problem is somewhere in my code!
  1. Load more activity