Hot answers tagged

60

I'd disagree with the accepted answer here. I'd call this an autotile, and not a 9-slice "9-Slice" (or 9-patch) is usually used to refer to a system where the content creator slices the image along 4 lines (not necessarily equally-spaced tiles). When rendering a rectangle, the corner slices are displayed at their native size, and the edges/center are ...


39

A name that will give you actual results in Google is 9-slice. Another way to call it and ask Google about it is 9-patch. As per this chat discussion, 9-pane seems to also be used, but the almighty Google will not show you what you need, unless you're into windows or something. Thanks to Kevin and Josh in chat for that.


4

As noted in a comment above, this is about units. If you use the value 9.81 as pixels/s² it's like watching something fall hundreds of meter when the ball shall cross the entire screen. It takes 9 seconds for something to fall 400 meters with v0 = 0, neglecting air resistance. It should be clear why this appears moon-like. It's all a matter of scale. To ...


4

The way fighting games work is with attack and collision boxes per frame. This way there is not a high/mid/low hit per se, a high-kick could for example hit a jumping character. In Street Fighter this looks like this: The hit is scored if a red box hits a opponents blue box. Red being the attack box and blue hit boxes In your example each frame of ...


3

Is memory efficiency really a problem? 2D textures are not typically huge enough to cause issues. Splitting the tilesets into too many textures may even cause problems in itself, since switching textures is not always cheap on the GPU. You should probably just optimize for your development efficiency at this stage. Unless you're intending to have loading ...


3

One obvious error in your current implementation is that you should combine nodes based on their total area, and not total radius. Otherwise you're overstating the visual effect by a squared factor - remember the area formula, pi*r^2. But you'll still run into other artifacts. An obvious one is that when you are zooming or refining your detail, there will ...


2

I think you may be misunderstanding what the Equals() method does - it's checking whether the GameObject instance col.gameObject is equal to whatever you pass in as an argument. You're passing in a Boolean value, which is not a GameObject, so the result will always be false. I think you mean to write something more like this: void OnCollisionEnter2D(...


2

I believe you should still want to use a perspective projection instead of orthogonal one, as there is still a perspective in it. There's some ways on how to achive it. One would be using a perspective projection and tweak the fov to achieve the narrow camera effect and maybe a low resolution framebuffer (OpenGL) and resize it to get a pixelated effect. ...


1

Use an orthographic camera instead of perspective camera.


1

There's going to be some variation in how you approach this, depending on whether you're going for "pixel-perfect retro re-creation" or "playable prototype to learn about making platformers." You don't need perfect precision to make something fun, so there's nothing wrong with taking a simpler route, especially in your early work. As I go through the steps ...


1

In unity when collision don't work you can fix the problem by following the below steps: 1.Set Collision and Triggers based on game(If game was 2d you should use BoxCollider2D) and check BoxCollider2D trigger Boolean. 2.you should check Rigidbody Component that attached to objects because Collision need physics component(if game was 2d you should use ...


1

you can use DontDestroyOnLoad on any gameObject to make it persistent between scene changes. Then simply have some logic that either enables or disables the object based on the level name. Another approach is to have everything in the same scene but on different layers and switch between cameras to render the desired object. Your way is also viable but its a ...


1

Calculate AC (xC - xA, yC - yA) Normalize it Multiply it by r Add that vector to A : done !


1

You could take a look at how phaser debug works: https://github.com/photonstorm/phaser/blob/v2.4.2/src/physics/p2/BodyDebug.js On line 90 you have the 'draw' function that shows you how phaser draw the shapes. If you take a look at the last part of the function you can have a way to get the verts of the polygons of each shape: verts = []; vrot = p2.vec2....


1

The easiest way of creating a grid is a 2 dimensional array. You didn't tell what language/game engine you plan to use but a search on arrays combined with your language of choice should give you the information you need. Treat all code examples in this answer as pseudo code- you will have to convert it, but it should illustrate the concept. An array is ...


1

You've got two simple options: Generate particles based on the velocity of the sword in the form of motion lines Draw up sprites and iterate through these using frames (couple of examples at http://www.spriters-resource.com/genesis_32x_scd/shinobi3/sheet/20808/)



Only top voted, non community-wiki answers of a minimum length are eligible