Leaderboard


Popular Content

Showing content with the highest reputation since 03/18/19 in all areas

  1. 3 points
    No bans are happening here (yet). @5neia_opo2@google-mail.ooo, try to understand the frustration people are experiencing. A new user came to the forum and in nearly every post they made trashed the project they were asking about. A lot of people here put in a lot of time and effort to not only to develop the project, but answer questions here as well. I was definitely frustrated reading your responses as someone who has put 6+ years of their life into this project. @botmaster did a poor job of handling that situation, but has apologized and I'm sure will do better in the future, as will you as well. Let's all be adults about this, acknowledge we did something wrong, and move on. @5neia_opo2@google-mail.ooo you are free to ask any question you need help with, but I definitely recommend reading through some tutorials, the examples, and checking the API docs before asking questions. It will often lead to you finding the answer yourself, and there will be less fatigue for the people answering here on the forum. I'd also recommend you approach things you don't understand, or decisions you disagree with, with a more open mind. Try to learn and grow the new library, not all libraries are alike and different problem spaces call for different solutions. Having a bad attitude is a good way to earn ill-will in the community and you may no longer get the help you expect if you are ungracious about it. When you find inconsistencies, or things you think should work differently, then change it! Pixi.js is an open source library built by the community. Everyone gets a chance to make the library better by contributing to it. The best way to get problems you have fixed, are to fix them yourself.
  2. 3 points
    I had some similar problems with this yesterday so I wrote up the workflow I found to work step by step. Hope this helps anyone else who finds this thread in the future. https://www.adammarcwilliams.co.uk/creating-bitmap-text-pixi/
  3. 2 points
    I am making UI Components Framework for Phaser 3, that is driven by JSFL-generated jsons and atlases. It means that you can build your UI in Abode Animate, export it with given script, and forget about manual code positioning and building stuff! Please, try it out. https://xense.github.io/phaser-ui-comps-docs/tutorial-showcase.html Docs, examples, tutorials: https://xense.github.io/phaser-ui-comps-docs There are two basic things in this framework. First is ComponentClip, which is a view instance, it is recursively self-build by provided json and atlases. Second is UIComponentPrototype, which is clip controller. It can be easily extended to create any components, windows or whatever you need. Essential meaninig of it is that it doesn't need a clip to exist always. For example, you can change states of a root clip, and child clip can get new clip instances, ore lose them, and nothing bad happen. Some base components are already included UIButton has 4 states, "up", "over", "down", "disable" UIButtonSelect same as button, but behaves like checkbox, has 8 states, by adding "_select" suffix to UIButton's states when selected. UIButtonRadio Selectable buttons, that can be grouped to select only one of them. UIButtonDraggable same as UIButton, but also emits drag event, drag bounds can be self externally. UIScrollBar vertical or horisontal bar with draggable thumb and prev/next buttons. UIProgressBar Setup only start and end elements positions, scale, rotation or alpha, and this component will interpolate them according to provided progress value. UIScrollPanel Helper for scrolling any element with UIScrollBar. UIContainer Base container component to add other dynamically created components inside. Can be easily extended to create any types of lists, for example. I'm still working on new components and extending existing functionality. Tell me, would you use it, what else components you may need, and whatever you think about it. Any feedback is appreciated! Also I'll be thankful to any collaboration. Available at GitHub and npm
  4. 2 points
    b10b

    ctx.clearRect() not working with Image.

    @James432213 hi, many issues here, all solvable. 1) The function named "canvas" rename this and avoid some confusion, call it "init" or similar 2) doKeyDown function has parameter "e" but references "event" in the switch - be consistent. 3) the functions doKeyDown, updateCanvas, drawPlayer are scoped "above" the "init" function, so they can have no easy reference to the "canvas" variable defined within "init". Notice also the name collision of "canvas" if we ignore step 1. Easy fix is to move these function declarations inside the "init" function. 4) There's nothing wrong with ctx.clearRect Some basics in how to debug your code will be beneficial, in particular the developer console (F12) is great, and using "console.log" can send helpful messages there from your code. Use that as a start towards watching the flow of your code when it runs, and where things are not actually working as might be expected on a first draft of code. This will lead to more advanced debugging techniques and more elaborate (and working) code.
  5. 2 points
    Do you draw something else than the video to canvas? If something taints a canvas then it stays tainted no matter what is rendered in the future. Or it might be due to stream becoming unavailable at some point for short duration and that could cause tainting (though the bug report I found on this should be already resolved, it was 5 years ago). Pretty sure it's some kind of edge case in security constraints which causes canvas to become tainted (by something), which causes security error when pixels are read from it.
  6. 2 points
    -AAG-

    I hate designing levels!

    There! I said it! 😡
  7. 2 points
    mattstyles

    I hate designing levels!

    Procedural generation can be a load of fun, but its a butt-ton of work to get working well. You could even use a genetic algorithm (GA) to create levels, have an automated actor play them, test the 'success' of the actor using fitness functions and then loop that process until you get levels (again, based on a heuristic function) that are fun to play. The up-shoot is that you can, potentially, create a near infinite number of levels like this. Or at least generate a manageable amount (say, 30) and manually curate them. Depending on how good your heuristics are you can create levels that are harder or easier for humans to play. It's a ton of work though. So depends on your mindset. Some crazy people find that a wonderful coding challenge.
  8. 2 points
    there is no public property available but you could use the following private property timer._pause working example: var timer = game.Timer.add(1000, function() { sprite.remove(); }); if(timer._pause){ console.log("paused") } else{ console.log("Not paused") }
  9. 2 points
    @dataj, I am pretty sure you can find all the information in the documentation. Maybe you forgot to associate your game to your business? https://www.facebook.com/help/publisher/709041312624617/
  10. 2 points
    ivan.popelyshev

    Fading trail

    Here's the second one, super-v5 stuff: https://pixijs.io/examples/?v=v5.0.0-rc.2#/textures/gradient-resource.js Yes, you can use it as an alphamask. Why do you need though? Your trail is simple rectangle, right? In fact, that's one of common mask use-cases in Flash: alpha gradients. Its shame we cant replicate all that Flash stuff even after several years of coding.
  11. 2 points
    ivan.popelyshev

    Fading trail

    First demo will be here in 5 minutes or so : https://pixijs.io/examples/#/textures/gradient-basic.js It took me only one cup of soothing tea.
  12. 2 points
    jonforum

    Fading trail

    What about create you gradient in other canvas. https://www.w3schools.com/graphics/canvas_gradients.asp var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); // Create gradient var grd = ctx.createLinearGradient(0, 0, 200, 0); grd.addColorStop(0, "red"); grd.addColorStop(1, "white"); // Fill with gradient ctx.fillStyle = grd; ctx.fillRect(10, 10, 150, 80); and than, create `generate` a texture from this canvas context ? Am sure it can work ... but at the expense of performance. I do not remember which one, but there is a rpgmaker plugin that used this process with pixijs.
  13. 2 points
    I've got a situation my physics simulation is running at high framerate (60fps), but some devices my app runs on cannot run the graphics (PIXI) at 60fps without causing the physics simulation to stutter and jump, causing undesired artifacts. So, in pursuit of performance, I shoved the physics simulator (in my case, matter.js) into a web worker, but then still found that some devices couldn't handle updates at 60fps in the main thread. So I started setting an interval to apply updates from the simulation to PIXI at a fixed rate - 30 fps to start. However, sometimes even on some devices that was unsustainable. So, the question came down to - what FPS *should* my app run at? And when I say "run", I'm talking about changing the position of PIXI objects base on updates from the physics simulation, not about changing the speed of the PIXI's ticker. Since the speed at which I could apply updates from the physics simulation and still achieve sustainable render speeds without lagging varied from device to device, I decided the best way to decide on the FPS to run at would be ... let the app itself decide at run time. So instead of coding a fixed FPS, or giving the user a slider to adjust, I let my app measure and adjust it's FPS based on what it measures as sustainable while it's running. Enter my solution for my app, FpsAutoTuner: https://gist.github.com/josiahbryan/c4716f7c9f051d7c084b1536bc8240a0 - contributed here to the community in case it may help someone else solve a similar problem. It's framework-agnostic, no external dependencies, written as an ES6 class, but could easily be rewritten as a ES5 if you wanted. FpsAutoTuner works by measuring the FPS (which you tell it by calling `countFrame()`) and then every so often (at `tuningInteval`ms), it compares that measured FPS to the `fpsTarget`. When the measured FPS goes below `fpsTarget` less `tuningMargin`, the `fpsTarget` will be decreased by `tuningRate` and the `callback` will be execute with the new `fpsTarget`. Likewise, when the measured FPS exceeds `fpsTarget` less `tuningMargin`, then `fpsTarget` will be increased by `tuningRate` and `callback` will be called with the new target. Example usage: // Somewhere at the top of your file import { FpsAutoTuner } from './FpsAutoTuner'; // Then later in your code, probably in your constructor of your game object this.fpsAutoTuner = new FpsAutoTuner({ fsTarget: 30 callback: fps => this.setFpsTarget(fps) }); This assumes that you have a function called `setFpsTarget()` on your class, probably that does something like this: // This is just an example method, on your own class... setFpsTarget(fps) { clearInterval(this._fpsTid); this._fpsTid = setInterval(this._render, 1000 / fps); } Then later in the rendering portion of your code: // inside the render loop of your code, call: this.fpsAutoTuner.countFrame(); That's it! Your app will now automatically adjust it's FPS as needed when it detects lower/higher frame rates available. (FpsAutoTuner automatically starts it's auto-tuning timer in it's constructor.) There are plenty of options you can pass to FpsAutoTuner to tweak it - they are all documented at the top of the gist. Specifically of interest, you can set `tuningInterval` (default 5000ms) to change how often it measures/changes the FPS. This all has just been a humble attempt to give back to the community. Use and enjoy. Contributions/changes/suggestions to the gist are welcome! Download FpsAutoTuner from GitHub here.
  14. 1 point
    TheBoneJarmer

    The future of web games

    Oh yeah, I remember reading that discussion. Well, to give my two cents. I think that discussion was pointless to begin with. I understand the question since there are not many popular hmtl5 games, but I would not call it dead, far from it. Web is a platform like PC, console and mobile. Most game devs use an engine like Unity3D or Unreal and export their game to platforms they can support. But games get exported more often to platforms where their game can run native because most games are too big to run smoothly in the browser. I mean, just look around and see how many devs actually created a 3D game in html5. Barely. And if someone did, is it probably low-poly. But that being said, that would be the only con I can think of. The biggest pro, and the reason I decided to go for HTML5 game dev, and not Unity or Unreal or any other engine, is because it is soooo damn easy compared to writing your game in C# or C++. I mean, all you need is a good IDE for web dev and your browser. And players don't even have to download your game. Heck, if you want to, you can put your game in a cordova container and export it to Android or iOS as if it is nothing. And just look at all the available resources. There are engines like Game Maker or Construct that allow you to export your game easily, as well as lots and lots of frameworks like Phaser, Pixi, MelonJS and so on. And also, since your game is actually a webpage, it can be integrated easily in many front-end technologies like Angular, ASP.Net, PHP and even NodeJS with Electron. That is also a very powerful benefit. Not to mention webhosting. I mean, a basic webhosting service is enough to host your game on since html5 games do not tend to be gigabytes big. Give it time. I admit I cannot think of a popular html5 game, but I am sure other forum members can fill me in on that one. I do see some gems once in a while. But those are often not only for web, but native too. They just have a web variant. You wont find yourself a whole RPG, but smaller games. But I like those, I am often very tired after work and to be able to play some small games while being half braindead is awesome, and very relaxing.
  15. 1 point
    I have solution for that thing - custom GlowFilter, but i dont want to publish it without extra preparations, because there are several filters i want to move to special plugin, filters that emulate Flash. I'm afraid that my queue of "who to help and make simple hack in 15 minutes" is too big right now Until then, I suggest to use make progress-bar sprite-basd and prerender everything you can in several frames in photoshop.
  16. 1 point
    themoonrat

    PixiJS Examples

    Hi all Just to let you know that we've moved examples for PixiJS version 4 to https://pixijs.io/examples-v4/ and the regular examples page at https://pixijs.io/examples/ are targeting the upcoming PixiJS version 5, using the latest APIs rather than deprecated version (`Sprite.from` rather than `Sprite.fromImage`, for example). All v5 examples are also in ES6+ now. If you land at the wrong one, don't worry, the menu on the left lets you easily switch between the 2 pages. The main point of this post; what examples would you like to see added? Is there anything you found tricky when you first started using PixiJS? Any techniques you saw posted on here that you think should get better visibility? Please let us know what you'd like to see, and we'll have a good pool of ideas to start with. And if you feel like helping us out by creating some examples for us, please go for it! Thanks
  17. 1 point
    Hello! The project is old so PIXI v.3.0.11 is used. For streaming - Flashphoner via WebRTC Steps to reproduce 1. Start video stream in html video element - stream.start(myDiv) which creates streamVideoElement in myDiv 2. When stream fires STREAM_PLAYING event the method PIXI.Texture.fromVideo(streamHtmlVideoElement) is called and the returned texture is set to the specific PIXI.Sprite instance. 3. Somewhere after this the Firefox browser receives error thrown by WebGl: Additional information The problem is happened very rerely Only Firefox Stream(video element) is not failed after the error In the PIXI source code that means: gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); What we tried tried to set video.crossOrigin = "anonymos" to the video element but no success. tried to dispose video like video.src = "" and etc according some advices related to the localStorage caching I know it's not directly linked by PIXI but still I need help. And the image of the current block when exception was thrown.
  18. 1 point
    setting width is actually changing scale. Unlike Flash, PixiJS doesnt have auto-scaled lines, lineWidth works in local coordinates, so vertical lines become very thin if your scale is small. If you have only a few bars (20 or so) you can just clear() them and refill again with the other drawRect width param. Judging by your labels that's the case
  19. 1 point
    -AAG-

    Is it like backstabbing my clients?

    I want to thank everyone for taking the time to leave a reply. I am taking it all in and think that I might have found a solution that solves this and my level design hate and I may even really like the game(s) that will result from that for a change. I do agree that web games in general are not great and I personally don't play a lot of them. In fact, I feel the same way about native mobile apps and have none installed in any of my devices. I do enjoy how accessible web games are and have found myself surprised by a few of them both when flash was a big deal and now with HTML5. It is this ease of use that I enjoy the most about web games. When It comes to my own games I have to go with what my clients are looking for. There was a time that my main client wanted arcade games and I made quite a few, not great at all but they got sold and spared me the level design dilemma. Then interest shifted to puzzle games so puzzle games it is and they have been selling. I have been doing this for a while and every single game on my catalog has sold multiple licenses (minus the obvious exclusives). I understand that doesn't make them good, that just means my clients liked them and thought them a good addition for their website. I'm sure they know their visitors and I have come to accept that it isn't my concern whether their players like the games or not, but the fact that they continue to buy from me tells me that my work is liked by a certain audience. At the very least I try to make my own thing instead of trying to follow trends or clone this and that because is popular unless the client specifically asks for it. I have avoided plugin to my catalog till now but if anyone wants to take a look you can go over here. Thanks again!
  20. 1 point
    5neia_opo2@google-mail.ooo

    def

    def
  21. 1 point
    HTML5 has become a trending technology in the current scenario of game development. Its dynamic update features and cross platform & cross browser compatibility gives lightyears of advantage as compared to its counterpart. This blog mainly talk about the benefits of HTML5 game development and why you need to hire HTML5 game developer. Read more: https://www.redappletech.com/how-to-improve-the-gaming-world-using-html5/
  22. 1 point
    Why does any stable release version of pixi not have properties that change the z-order of sprites/containers? I see that the development v5 version has it. Why has it taken 5 major versions before someone realized that zOrder would be a good idea. I'm probably being ignorant but I would like an explanation because it seems pretty important when rendering graphics
  23. 1 point
    Thank you Adam! Would you be willing to share some example code of a barebones working example (if it's easy)?
  24. 1 point
    taoprox

    Project MWX - multiplayer RPG

    Hey Semir, I am focusing a lot on my game editor at the moment, I've hit a point in development where I need a lot more attribute data for sprites and objects, and therefore need a easy way to edit this. I will always write here for you whenever I make any progress and be sure to keep checking my youtube channel for more videos in the future! I appreciate your interest in this, and in the future when I need help testing it, you will be one of the first I will ask! Thanks, Tao
  25. 1 point
    In my honest opinion I think you should not ask us, but Google. I understand your frustrations and I too need to admit I don't really can make head nor tails from what they sent either but they do. So my suggestion is to first read that article about the Metadata you can access by clicking the link in step 1 below the heading "Next steps". If that does not make sense to you, you should send them an email about clarification.
  26. 1 point
    ivan.popelyshev

    How to center PIXI.Graphics?

    I wish you good luck in understanding how transforms work. Also beware of width/height , those are calculated properties.
  27. 1 point
    To summarise: Issue has nothing to do with resolution, it's roundPixels settings which is not working for meshes in v4: https://pixiplayground.com/#/edit/6zh8TlmkVtjxOBNPqh4f3 Similar code in v5 works fine: https://pixiplayground.com/#/edit/QKnINN4IETVUmNf80K8KT
  28. 1 point
    There are two sequential frames from animation, where dragon sprite and attached piece of UI moves from up to down. Left one is normal and right one is bit broken. Sprite itself (PIXI.extras.AnimatedSprite) and number 8 (PIXI.extras.BitmapText) looks perfectly fine through all animation, but HP bar background (PIXI.mesh.NineSlicePlane), HP bar itself (PIXI.Graphics) and number background are not hitting pixels perfectly sometimes and animation looks jaggy. PIXI.settings.SCALE_MODE is PIXI.SCALE_MODES.NEAREST. PIXI.settings.MIPMAP_TEXTURES is false. roundPixels is true. As I said, I have retina screen, so resolution is 2. I'm not sure if issue is reproduced on regular screen. I've searched through the docs but couldn't find any special settings for PIXI.mesh. I can make same UI from basic sprites of course, but NineSlicePlane is so much more convenient.
  29. 1 point
    I dont see any round-related code in mesh in v4. https://github.com/pixijs/pixi.js/tree/v4.x/src/mesh and in graphics too: https://github.com/pixijs/pixi.js/tree/v4.x/src/core/graphics . Also, make sure that screen size is less than 4096 and CSS width/height that pixi set corresponds to canvas width/height.
  30. 1 point
    Marius

    Project MWX - multiplayer RPG

    it remembers me the old pc games. Nostalgia ❤️
  31. 1 point
    lokhmakov

    Extract with smooth edges

    Thanks. Next solution works fine: downloadBtn.addEventListener("click", e => { app.render(); const imageUrl = app.renderer.plugins.extract.base64(); let link = document.createElement("a"); link.href = imageUrl; link.download = "picture.png"; link.style.display = "none"; document.body.appendChild(link); link.click(); link.parentNode.removeChild(link); });
  32. 1 point
    roxor45

    right click event

    lol don't worry , it's not a porn avatar it's an avatar from my google account , so no pb i change that . back to Js I try that and I come back ! thanks !!!
  33. 1 point
    jonforum

    right click event

    note that the console debug will indicate some missing information in the console. To debug with more precision it necessary to use breakPoint. The information in the console will be obsolete because they are compute only when you open the debug objet and can mislead you.
  34. 1 point
    I am trying to create a click through image gallery for a project in pixi. You can see in my fiddle when you click on the right side of the screen it adds the next image. The problem is when you click on the left to delete the image it will only delete one and not the rest. Can someone please help me with this issue. If you have any more questions, please feel free to ask. If there is a better solution please let me know. https://jsfiddle.net/jacob_truax/5p4n9a8m/2/ const createSprite = function() { imageCreated = true image = new Sprite(resources[images[step]].texture) image.width = 400; image.height = 300; image.x = left app.stage.addChild(image) step += 1 left += 40 } const removeSprite = function() { app.stage.removeChild(image) step -= 1 } loader.load((loader, resources) => { createSprite() }) nextTag.addEventListener("click", function() { console.log("next") createSprite() }) backTag.addEventListener("click", function() { console.log("back") removeSprite() })
  35. 1 point
    @dataj I don't teach HTML5. I reply relevant Instant Games related questions. Good luck with your game though
  36. 1 point
    Umz

    [Phaser 3] Maggot Diorama 2

    Work of art just like the last one. Nothing but impressed with this!
  37. 1 point
    taoprox

    Placing objects in a 48px grid

    Problem 1 can be solved by subtracting half the size of the image from both x and y. I am not too sure what you mean in problem 2, it looks like it is aligning properly.
  38. 1 point
    ivan.popelyshev

    Fading trail

    Basically what do I want: I create gradient for Canvas2d or make it manually, and then upload that canvas with fromCanvas() or from() or more sophisticated method. Alternatively: there is difficult implementation of meshes with colored shaders in https://github.com/gameofbombs/pixi-heaven : https://gameofbombs.github.io/examples-heaven/#/mesh/rope-colored.js . Modify it to affect sprites-only and make it simple if you think you have enough time to learn it. Here, I gave you ALL the code I have regarding gradients. You can wait for other guys but as far as I know no one else cares about gradients except you and I. Maybe there's a lurker Again, PHOTOSHOP is your best friend. I still dont understand why dont you like "make a texture in photoshop" approach.
  39. 1 point
    ivan.popelyshev

    Fading trail

    Better to ask third time in same subforum Make a png in photoshop and make a sprite or wait when I fix that code to work in v5: https://gist.github.com/ivanpopelyshev/6128a6b31f1a7f51d536b369a3812ecf
  40. 1 point
    its rotating relatively to container position. Set container position to (x,y) and remove those variables from positions of all children. Welcome to Flash world.
  41. 1 point
    Hmmm, good question. Appreciate the consideration. Looks like most in that list are github projects/npm packages? I suppose I could just put this in it's own repo in GitHub with a readme and that might be more orderly for linking that using the thread. What do you think?
  42. 1 point
    var imageContainer = new PIXI.Container(); PIXI.loader.add("http://127.0.0.1:54508/resources/data/data.jpg").load(function(loader, resources){ var base = resources['http://127.0.0.1:54508/resources/data/data.jpg'].texture.baseTexture; var maxWidth = 2048; var maxHeight = 2048; for (var x = 0; x < base.width; x += maxWidth){ for (var y = 0; y < base.height; y += maxHeight){ var minWidth = Math.min(maxWidth, base.width - x); var minHeight = Math.min(maxHeight, base.height - y); var canvas = document.createElement('canvas'); canvas.width = minWidth; canvas.height = minHeight; canvas.getContext('2d').drawImage(base.source, -x, -y); var texture = new PIXI.Texture( PIXI.BaseTexture.fromCanvas(canvas), new PIXI.Rectangle(x, y, minWidth, minHeight) ); var sprite = new PIXI.Sprite(texture); imageContainer.addChild(sprite); } } viewport.addChild(imageContainer); }); This is a silly question but i'm banging my head for an hour and can't figure it out I'm trying to split an image into smaller texture chunks but i'm getting frame does not fit inside base texture dimensions and i'm not sure why this is happening The image height is 3106 and after the second iteration of the inner loop the y is 2048 and minWidth = 1058 so it should work there is not third iteration of the inner loop to give out of bounds error ... Thanks for reading . also i'm not familiar with ES6 yet, so don't judge
  43. 1 point
    Noel

    how to Monetization facebook instant games ?

    @sisko Don't write in bold, it is not nice to the eyes, Have you read our documentation? https://developers.facebook.com/docs/games/instant-games/guides/ads-monetization You cannot use Admob within Instant Games.
  44. 1 point
    good work
  45. 1 point
    ivan.popelyshev

    Gradient alpha on a shape

    pixi v4 or v5? Current way is to generate texture in photoshop or paintDOTnet . I can provive new way for v5 today or in weekend
  46. 1 point
    Split all and handle multiple resolutions and only load higher resolution based on what's displayed and the zoom level. It's a lot of work? Hell yes but that's what a pro like you must do to earn his living and deliver a good software.
  47. 1 point
    Hi @maximlus, welcome to the forums Logins need two things: * A way to track logged-in status * A way to set logged-in status You can track logged-in status on either the client or on the server, but you almost always want to track _something_ on the client. The complication comes from identifying _who_ that client is, and that you can not trust clients. A common flow for a single-page application (your game probably is this) would be something like: * Hit your webpage holding your game * Navigate to log-in screen * Enter log in details (e.g. id/email, password) * Send those to your server. Check the details, if correct, generate a token, store it, send it to client. * Client stores this token (local storage is fine) and uses it to make subsequent requests or to actually enter the game. * Next visit, when client boots up (after hitting the url), check local storage for a token, maybe send it to your server to check it is still valid, become logged in. This flow means you have to store 3 things: * id/email and password details (server) * valid tokens (server) * logged-in status (client) Valid token status dictates logged-in status i.e. you should probably check the token is valid before assuming that it is. Tokens normally have two things: * An expiry * Are revocable An expiry means they will expire, you don't necessarily need to store this on the client, i.e. when the expiry date is hit then delete from server storage, when a client tries to use it, that operation will fail and you'll direct the user to a place where they can enter their details to generate a new one. This system also means that if you think anything is compromised (or problematic) then you can revoke a token. You could go a step further and associate a token with a user explicitly which gives you more control if you want to boot out a user, i.e. you revoke their token so they stop immediately, and you stop them from being able to generate a new one. It is normal to do this link between tokens are users, check out JWTs. If your game requires accessing authenticated endpoints (getting levels, scores, anything really) then using a token to do the auth stuff is quite nice i.e. your services _could_ inspect the token and respond appropriately for that user (or user type) i.e. to get the _next_ level, you wouldn't have to ask for it from the client (remember, don't trust clients), you could hold current level on the server and your endpoint could inspect the token, inspect the current level (and completion status maybe) and return the next level. There are lots of services out there that can handle these flows (and more complicated ones, such as 2FA) for you. It's worth looking up how they work and if they would work for you. Unless you want to code this all up and have to deal with holding emails or other personally identifying information (or even user tracking).
  48. 1 point
    Babsobar

    Zooming out on tilemap layer?

    Just wanted to update that this problem was fixed by a recent update of Phaser.
  49. 1 point
    OIMO does it like this: https://github.com/lo-th/Oimo.js/blob/gh-pages/examples/test_collision.html#L209 You can edit shape.collidesWith and shape.belongsTo in an oimo rigidbody: https://github.com/lo-th/Oimo.js/blob/gh-pages/src/shape/Shape.js#L68
  50. 1 point
    brentstrandy

    Text Underline [SOLVED]

    I just finished extending the Phaser.Text object to add underline functionality. You can find the code here: https://github.com/brentstrandy/phaser-underline-text/blob/master/underlineText.js Any feedback would be appreciated!