Flat two-dimensional space. Positions represented with `x`, `y` coordinates.

learn more… | top users | synonyms

-1
votes
2answers
97 views

2D C# Collecting Item For Acceleration Unity

I have an issue regarding acceleration for Unity in C#, I'm trying to have my player collect an item and gain speed from it. Now, I have this working, but I need it to be a gradual acceleration, I ...
1
vote
1answer
86 views

Accessing the child sprites of a sprite sheet in unity?

I have a spritesheet set up with the individual sprite regions named in unity. I haven't been able to find out how to access these sprites by name?
0
votes
1answer
89 views

Making a zoom out/in space map in Unity

I'm new to unity, I was wondering how would one go into implementing a dynamic 2d space map. Let me give you an example what i mean. You see our solar system on the map, if you zoom out at a treshold ...
2
votes
2answers
216 views

C# 2D Enemy Follow Y Axis Only While Rotating to Look At Player (Unity)

I have a 2D game where the player can move up and down on the y axis, I need the enemy to rotate to look at my player (which I have working, but probably isn't the best method) while also moving up ...
0
votes
1answer
118 views

Efficient modification of Texture2D at runtime for a 2D painting game in Unity3D

I have spent some time looking for different solutions to be implemented in a mobile painting game I'm creating. At this time, everything is working but I have some serious performance problems on ...
0
votes
1answer
76 views

Working but flawed bullet spread (vector math)

I'm trying to implement random bullet spread into my game, and I've managed something that works, but is consistently flawed. The spread doesn't vary depending on the distance the mouse is from the ...
1
vote
1answer
57 views

Box2D No Gravity when moving against wall

I use Box2D in my current project and I have a problem with the gravity.. You can see my problem here: https://www.youtube.com/watch?v=2_kv9LkKwN4&feature=youtu.be when i jump normal everything ...
0
votes
2answers
113 views

[Unity]Making sure playermodel only moves 1 unit

I am doing a school assignment based off of the Unity3D tutorial 2D RogueLike (all code available here) In my version though, the movement is not turnbased and I am having some trouble figuring it ...
0
votes
2answers
53 views

Calculate land center on grid

I have a grid based game. The main map is 2d array with land ids, something like this (here are 2 lands on the map, one formed where the 1's are and one formed by where the 2's are): [ 1 , 2 , 2 ] [ ...
1
vote
0answers
89 views

How do I create this type of mixed 2D/3D character model?

I'm interested in how this little Lively Hamster Flash game's character is modelled and animated. The head seems 3D. The back always shows a black outline, so I assume it is 2D. Is this a ...
2
votes
2answers
105 views

2D Simplex Smooth Cave Generation

So I'm creating a system of caves below my random terrain generation, and I'm using 2D Simplex Noise to do so and I have a pretty good grasp on generating the random caves. However, the cutoff from ...
1
vote
1answer
68 views

1D Simplex Noise Returns Same Generation

I've been using 1D Simplex Noise to create a random world surface, and it keeps generating with the same looking surface terrain, with some minor variations. Here is my sample code- Tile[][] tiles = ...
0
votes
3answers
100 views

How to change the gravity with a click

How to change the gravity of a ball upward with a click Then change it again downward with another click And so on In unity
0
votes
0answers
40 views

Is resource management a good idea when dealing with animations?

New to the Unity environment here and I have a question concerning how to efficiently manage computer resources in a top down 2D game. I have a large area that looks like a 2d rpg from the 90's and ...
5
votes
1answer
120 views

QuadTree-based pathfinding for a volume body

I want to make a game where a player follows a mouse pointer. The game is not tile-based. I use quadtree for a collision detection and everything works fine. But now I want to develop a player ...
8
votes
3answers
308 views

Using full resolution of depth buffer for 2D rendering

I'm working on a front-to-back renderer for a 2D engine using an orthographic projection. I want to use the depth buffer to avoid overdraw. I have a 16-bit depth buffer, a camera at Z=100 looking at ...
3
votes
5answers
1k views

Trying to implement gun cooldowns in C#

My aim is to allow my player to shoot 3 bullets at a time. Between shooting these 3 bullets the player should wait a very small interval (so that they don't all get fired at the same time) - call this ...
3
votes
3answers
333 views

Algorithm for dividing a 2D grid into organic looking plates

the title pretty much says it all: How could one go about segmenting a 2D grid into smaller parts? My goal here is to create tectonic plates for further procedural world generation Details to ...
0
votes
2answers
471 views

Basic C# Script in Unity3D for firing a bullet (not working)

working on a 2D top-down view game. Im trying to get my player to fire a bullet when spacebar is pressed. I added a component to my player (a bullet sprite) and placed it under his gun (so you can't ...
0
votes
2answers
309 views

Moving a character depending on the direction he is facing (C#/Unity3D)

Right now I have a small soldier on the screen that moves with W, A, S, D and rotates / changes direction with the arrow keys. What I want to happen is when the player's direction changes (by using ...
0
votes
1answer
47 views

How to read a custom map format [closed]

I am trying to create a custom map format for my own little 2D RPG, so my question is rather how do I manage reading and creating a custom map format properly and flexible. First off, I am writing my ...
0
votes
1answer
33 views

Importing .anim files created using the Unity Animation controls

Our artist created some .anim files using the built-in Unity Mecanim system (where you use keyframes and drag various body parts to construct the animation). However, now we're trying to export them ...
1
vote
1answer
84 views

Unity3D: Storyboard-esq animation - a beginners question

As part of an interactive book I'm developing in Unity3D, I'm attempting to make an introductory scene that consists of moving lots of objects at different times - usually when another animation has ...
-1
votes
1answer
49 views

Java libgdx get clicked square without iter

I would like to detect which square is clicked without iterating over all elements! i don't want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <= ...
1
vote
2answers
88 views

Accessing a newly Instantiated Object

I currently am creating a script that allows the player character to attack by shooting orbs at foes. I have the current code to do that (not final code, for testing purposes): ...
0
votes
1answer
78 views

How to draw 2d above 3d scene?

I have an OpenGL(3.3)+GLEW application. I want to draw a black vertical rectangle at the left side of the window for writing some information on it, like fps (I use GLEW function for drawing text). ...
0
votes
1answer
55 views

Unity 2d - Destroying foreign object from script + seek explanation about destroying objects

I have simple emmiter which sending enemies toward player in center of screen. Player can shoot missile (also emmiter). I want to destroy enemy AND missile in same time. Here is my code attached to ...
0
votes
0answers
186 views

Unity changing texture of RawImage from code

I have a UI element, RawImage, which I would like to change the texture of based on which random number between 1 and 6 is generated. I want to change the picture of the dice, but I don't know how ...
0
votes
0answers
45 views

Need help solving an acute-triangle to find the distance to the outside of my object

I recently asked a question here: How would I check the range against the entirety of an enemy object, and not just it's transform.position? That was accurately answered, and works perfectly ...
3
votes
1answer
125 views

Optimizing the “visibility cone” calculations for a 2d game

I'm creating a simple 2D game and got a little bit stuck with this algorithm. What I wanted to achieve - and achieved - is to draw a visibility cone influenced by walls and other obstacles on the map. ...
2
votes
1answer
107 views

How to divide sprite sheet, but keeping the in same png?

first post here, but couldn't find an exact answer in your database, so guess I'll have to ask. I want to know how it is possible to create a ".META" file for a .png so you can extract individual ...
1
vote
1answer
48 views

Entitiy spawn on Button press

I'm trying to create a little 2D-Zombie-Shoot game. I'm pretty much at the beginning of programming. At least, I can create a player that is moving with arrow keys and stuff. My question is: How do I ...
0
votes
1answer
52 views

Would flipping a sprite depending on direction be too inhibitive for modders? [closed]

For a game I'm making (similar to games like Terraria, Starbound etc.) I want to ensure that the framework is as modder friendly as possible. This leads me to wonder if it would be too inhibitive to ...
1
vote
1answer
97 views

Proper way to divide a 2D climbing animation in Unity3D

I've got a 2D character that's going to climb up a 2D tile to his left or right and I've got a climbing animation consisting of three parts essentially: Animation for the character going from ...
0
votes
2answers
204 views

A 2D Camera Follow Script That Does Not Rotate?

I am attempting to make a 2D racing game. So far I have a player car (sprite) and a main camera. I would like to know how to make the main camera follow the player car while still showing signs of ...
2
votes
1answer
71 views

Multiple enemy collidiers

I currently have an enemy that upon collision kills the player with a kill script, I want to add another collider that acts as the visibility radius for said enemy. However, when adding another ...
2
votes
2answers
66 views

Unity2D Sprite flips camera when moving left and right

I am using the Unity Engine and coding in C#. I have a sprite as a parent with a main camera as a child so that the main camera follows the sprite. However, when pressing 'A' and 'D' to move the ...
1
vote
2answers
197 views

How to detect collision of a wall with grid movement?

I have this little game, where my player is moving around a simple level, using a grid based movement script (See code below). My problem is that I have tried to implement a 2D raycast, which has to ...
0
votes
1answer
76 views

Sharing Tiled Maps [closed]

Where can share my existing Tiled maps, as well as download and use other people's existing maps?
0
votes
0answers
60 views

2D animation customization based on 3D model

We're looking for a good pipeline to create animated assets for our 2D game. Characters are seen from isometric viewpoint, and there are several characters with the exact same animations (idle x 4 ...
2
votes
3answers
324 views

In a 2D top-down game, how can I create projectiles that have a height?

A 2D game called Deer Hunter has projectiles like this: Are the projectiles 2D or 3D models? How could I implement something similar?
0
votes
0answers
48 views

In Java swing, while handling a 2D top down game, how should I handle scaling for quality transformations (mainly screen rotation)

For my top down game, I plan to have screen rotation where entities don't rotate, but everything else does. I am using a raster array to store my image so I don't have to render things stacked on each ...
7
votes
2answers
998 views

In Unity, why is adding a Vector2 and a Vector3 ambiguous but assigning isn't?

Given the following two vectors: Vector3 v3 = Vector3.one; Vector2 v2 = Vector2.one; This line is ambiguous: v3 += v2; // Unity reports dimension ambiguity whilst this assignment isn't: v3 = ...
3
votes
1answer
110 views

Is creating a blend state like this possible?

I'm wanting to create a custom blend state that is similar to XNA's BlendState.Additive, but slightly different. I'm wanting something like the 'custom' output below: Is something like this ...
0
votes
2answers
117 views

How to keep a shape inside a rectangle

So i'm making a game which is based on randomly generated rooms and i need a way to keep the player inside them and make the player glide when he collides with the room's bounds. I currently have a ...
0
votes
1answer
234 views

Unity 2D - scale sprite according to screen width

So I have a square sprite (width == height) and I want to scale it so that both width and height are exactly one fifth of the width screen. To find the desired pixel width I do: float ...
-1
votes
1answer
113 views

How do i load, render and trasnform 2D images using Direct3D 11 API? [closed]

In my small game project using DirectX 11 API, I created a Direct3D device, and can draw 3D meshes, using web tutorials and a book. But I cannot figure out how to load, transform (rotate, scale, ...
2
votes
1answer
759 views

What is AABBvsAABB Collision detection?

Currently studying Game Engineering at university and my lecturer has asked us to implement a collision manager. He asks us to use AABBvsAABB to build it, so then we can add the physics. My question ...
1
vote
1answer
73 views

Monogame - stopping a custom shader (drawable game component) when inside another drawable game component [closed]

I have run into a bit of trouble when using a custom shader (gaussian effect) within another drawable game component, as I cant figure out how to break out of the draw method, so the effect is applied ...
3
votes
1answer
80 views

How do I render an object's position trail of a constant length?

I want to show a trail of the last points that the object has been in, but I want that trail to always be a certain length, regardless of the object's speed. How can I do that? At the moment, I ...