Tag Info

New answers tagged

1

I'd use two rules, one for tiles and one for corners of tiles: If a floor tile is surrounded by three wall tiles and one floor tile, then that floor tile is an end of of a corridor, and should be marked with a waypoint. If a corner is surrounded by one wall tile and three floor tiles, then that corner is a place where you might want to make a turn. The ...


0

I hope this is the answer to your problem, not something obvious you already know. If it is, sorry! You can keep the track of the last loaded tiles in each direction in blue dimensions and the movement of camera in red ones. For example, when the user starts, if it starts from the center, mathematically, the tiles will be loaded based on this formula: ...


1

First off, I would store paths as an array of points/vectors/ whatever they call it in the framework you're using. It's a coordinate, using x and y variables. When the player builds a path, you know the x and y coordinates of that point (let's call them points). For all your path arrays, check if it contains one of the 8 adjecant points (same x, but y+1, ...


1

When you say "Javascript" you certainly mean "running in the web browser". In that case, peer-to-peer networking isn't possible because there is no browser-independent standard for this. But what you can do is having a server. One technology which is quite well-suited for real-time games are websockets. You can prevent most kinds of cheating by having an ...


2

You got it wrong in your draw code : once you translated the context to a given point, you shouldn't use any more the point coordinates : the 'zero' is now at the translation point. So to draw your arrow after you translated to its start point, just translate by the size of the arrow. http://jsfiddle.net/gamealchemist/jxrdtLxx/2/ function ...


0

In addition to having a ridgidbody (one must be present for OnTriggerStay to be called at all), you may also want to try different 'collision detection mode' types on that rigidbody. If the ball is moving too fast the default 'discrete' might not be accurate enough to see the ball whizzing by, and if the ball is going too fast then the 'Continues Dynamic' ...


0

You need a rigidbody connected to at least one of the objects with a collider (as @Savlon mentioned), but the other issue with gravity can be alleviated by toggling the rigidbody's Kinematic attribute.


1

This is hugely dependent on the type of the game you're creating. For say Chess, the only thing NetworkClient would do is reacting on the move being made and sending that. Some other games might send parts of their state or even the whole state. In general, you might think about splitting the networking part into two smaller components: the transport that ...


0

I would rather consider using Application.srcValue which is the path to the web player data file relative to the html file (Read Only). Then you can attach a "?" with a parameter string.


0

Your normals are supposed to be the face normals of a polygon. If your vertices are an oriented array in counter clockwise order, then you can easily compute the normal of a face by a 90 degree rotation. So if we have an edge on a polygon made of the vertices a and b, we know that the edge is oriented from a to b going around the polygon in CCW order. To ...


0

This is a somewhat broad topic as the problem is not how to fix something but more akin to planning ahead to use the "best" structure and avoid potential problems in the future. And thus, depending on your requirements and complexity you are aiming for this may be entirely a non issue. That being said, I have a 2 suggestions: Composition over inheritance ...


0

An effective but complex method would create states for every object. These states would be along the lines of Active, InActive,and Remove. Active = Update/Render Alongside all other 'objects' with this state. InActive = Don't Render or Update at all, this must be activated before anything happens with it. Remove = This means for whatever reason, the ...


2

The Chromium-based WebView causing this issue was eventually updated in KitKat version 4.4.3/4.4.4 in mid 2014, but that is cold comfort considering some vendors have made some seemingly arbitrary decisions about which of their phones got the update and which did not. Samsung Galaxy S4, for instance, is still trapped at 4.4.2. Follow the advice given by ...


0

Instead of Physics.Raycast, use Physics.RaycastAll. I'm pretty sure I've run into this same problem and I don't see it in the documentation for Raycast but it's in RaycastAll that order is not guaranteed. I assume this carries over to Raycast as well. Even if it doesn't and this doesn't solve the issue for you it should be able to assist because it will ...


1

Did some testing and I think your only mistake is in adding the offsets rather than subtracting them. Other than that it's been working for me, although you could simplify those equations quite a bit to get rid of all those divisions. While trying, I've written this example code on JSFiddle. I omitted drawing the grid, but you should see a moving "tile" ...


0

I ran into the same issue with Phaser (with this simple game). Unfortunately, with HTML5 and web/canvas rendering, you're at the mercy of your phone -- there will be users with broken or poorly-performing browsers (like mine). Like @captainbuzz123 suggested, the only real solution is to move to a non-HTML5 platform. My tool of choice for now is OpenFL. ...



Top 50 recent answers are included