7,585 questions
-2
votes
1
answer
94
views
Algorithm to calculate how much blend of points is a specific 2D point [closed]
I have a Set of 2D points that I want to create a set of areas from, similar to a Voronoi Diagram.
The difference is that I would like these areas to be blended, like in the following image.
I wouldn'...
1
vote
1
answer
89
views
How to freeze a player so that he does not move to one side
How can I make it so that the player cannot move, even through physics, in one direction?
I tried this option:
using UnityEngine;
using UnityEngine.InputSystem;
public class Player: MonoBehaviour
{
...
0
votes
1
answer
149
views
How to fix the Unity error in this image?
Hi guys I'm erroring unity, can you help me?
How do I fix it?
I downloaded Unity after a long time and I just downloaded it. Based on this, what should I do? I already downloaded the latest version.
...
1
vote
1
answer
75
views
C# SkiaSharp draws translucent pixels too dark
I'm working on a script that needs to take images and stack them. Image 0 at the bottom, image 1 over that, image 2 over that, etc. etc. with Image n on the top.
Essentially, I want the final product ...
-1
votes
1
answer
46
views
Issue with Zooming when projecting 3D on to a 2D surface
Please note that this is a learning exercise for me, so I am not using third-party libraries or matrix transformations provided in .NET. The example included below displays a cube on a form and allows ...
-2
votes
2
answers
140
views
a Java streams way to zero a 2d java array of objects each containing a 2d array? [closed]
public static class al_s {
int path[][] = new int[4][5];
}
static al_s already[][] = new al_s[10][10];
I need to zero the variable 'already' over and over. Specifically, zero the 'path' of each ...
0
votes
0
answers
29
views
Rigged Character Shows in Front of UI Panels Even When Placed Behind in Hierarchy
I'm working on a 2D mobile game in Unity as our project, and I have a rigged character called Bytebotx. I want this character to always appear behind UI panels, like the Settings panel, whenever they'...
0
votes
1
answer
50
views
I have 2d islands procedural generation on Godot. How can I check if a point is on surface?
By 'point', I mean a RefCounted, with these properties:
var pos: Vector2i
var is_surface: bool
var is_bottom: bool
And by 'surface', I meand a point, that doesn't have another point above it.
The ...
0
votes
1
answer
53
views
How to draw clamped large isometric map with occlusion?
I want to draw a 500×500-tile scene forming a flat isometric surface.
The tile width/height ratio is w = 2:1.
The X/Y axes originate at the top-left corner of the screen.
The logical x-axis points ...
0
votes
1
answer
88
views
How to create a bullet regeneration bar in python/ursina engine?
I want to make a bar that shows a variable like bullet regeneration time. I know that to do this I need to change the scale parameter given to Entities.
But when I tried to change the scale parameter, ...
2
votes
2
answers
81
views
Show more than initial frame for animation of wave propagation with time in Jupyter
I am trying to see the wave propagation as time progresses. For this I am using finite difference method. However, with the latest jupyter notebook I am unable to obtain the figures. When I run the ...
2
votes
3
answers
99
views
How to rotate a 2d circle around another?
I'm trying to rotate a circle around another circle in 2d.
I have the following code implemented, which rotates the circle on its axis, however, I want to rotate the circle around the other one.
var w ...
0
votes
0
answers
70
views
Map a 3D coordinate to a 2D view [duplicate]
I am trying to map 3D coordinates to 2D coordinates using the following classes:
public class Point3d
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; ...
0
votes
2
answers
104
views
Godot weapon resources with animations?
I'm new to game development and I'm making a 2d Souls like and want to know how to make weapon resources have animations
I've been trying with animated sprites and spritesheets but I get an error ...
1
vote
0
answers
143
views
Simple and Lightweight Collision Detection (and Reaction) in C# (Windows Forms)
I am looking to create a 2D Topdown Shooter in Windows Forms.NET (C#). I have player movement & enemy movement, player & enemy rotation (player aims towards the mouse, enemy aims towards the ...
-4
votes
1
answer
169
views
Unity ScrollView — Vertical scrollbar always visible, horizontal scrollbar never works
I'm building a 2D level editor scene in Unity for my game, which includes custom width and height.
Setup
I have two text inputs where the user enters width and height.
Based on those inputs, I ...
0
votes
0
answers
23
views
Filtering 2D Coordinates of Visible Emptys in Blender, Excluding Those Obstructed by Multiple Objects
I'm using Blender's Python API to get the 2D coordinates of all EMPTYS that are "visible" in a rendered 2D image (i.e., within the camera's view). I have a working script that retrieves the ...
0
votes
1
answer
55
views
jagged line with drawLine() using Java AWT
I'm testing 2D walk of specific math functions using Java AWT, and I found weird patterns. Manual drawing 2D walk of the functions didn't show any weird patterns, so I started to check Java AWT ...
1
vote
1
answer
81
views
How to Resize a Rectangle Using Hover Dots in Three.js While Keeping One Edge Fixed?
I am working on a Three.js project where
I need to resize a rectangle interactively using hover dots.
The rectangle has two hover dots, one on the left edge and one on the right edge. like this in the ...
0
votes
1
answer
63
views
I have created a thread Variable in java and I got this error: gameThread cannot be resolved to a variable [duplicate]
Hi I got an error that is about the gameThread variable in my java code
is says:
"Exception in thread "Thread-0" java.lang.Error: Unresolved compilation problem: gameThread cannot be ...
1
vote
0
answers
66
views
Fake Road 3D Effect in C# Monogame
currently I'm trying to achieve a fake road 3D effect in monogame. I used this tutorial so far:
https://www.youtube.com/watch?v=xTyURl8qjZw
I successfully translated the first part where the road goes ...
-1
votes
2
answers
38
views
2D object doesnt collide with my player object
trying to make a flappy bird clone and i cant seem to make the player and walls collide (very new beginner) so was looking for solutions and none of them worked for me
using UnityEngine;
public class ...
1
vote
0
answers
54
views
My character can't move while jumping when the scene resets C# Unity 2D
So basically my character can't move while I jump or I am in the action of jumping while the scene resets so if the scene resets while I'm jumping the character can't move. also the character gets ...
0
votes
1
answer
59
views
rapidly increasing gravity making the jump not work
Im making a flappy bird clone for practice and while making the jump feature im having issues because at the start the jump works but then gravity gets so strong that even if im still moving upwards ...
0
votes
0
answers
61
views
Correct Depth Ordering for Isometric Rectangular Prisms in a 2D Game (Avoiding Z-Fighting for Irregular Shapes)
As a preface this is not a question asking for code, I am simply seeking a process, or math formula.
I'm working on a 2D game that has an isometric perspective to simulate a 3D world.
The objects in ...
0
votes
2
answers
60
views
Unity 2d Enemy patrol
So, basically I want the enemy to be moving dynamical between the targetpoints, right now the enemy is like teleporting between them. I already tried multiple other methods because I thought that this ...
0
votes
1
answer
86
views
Not having much success plotting 2D concentration data [closed]
I'm trying to plot what I believe to be a simple figure that will give a 2D interpolation of concentration. I've tried ggplot of the data using geom_raster (results in a blank plot), ...
0
votes
1
answer
59
views
How to draw an monochrome image to a Context2d with specific color?
Say I have an image that I can pass to ctx.drawImage(...) and it's all one color (e.g. #fff). Is it possible to draw this image as another color (say #f00) without rebuilding the image via ...
0
votes
1
answer
42
views
Why I cannot handle my signal inside my child class while In the parent I can?
I have this class which is responsable to send me a signal each time my character detect's a parry:
class_name CharacterAttack
signal attack_parried_detected
func _init(body: CharacterBody2D):
...
0
votes
1
answer
44
views
Unity 2d enemy patrolling not working properly
so the main problem is that the Patrol() method is not getting called, its my fist time working with inheritance and I suppose theres something wrong with how Currentstate gets set. My idea was that I ...
1
vote
1
answer
65
views
Unity 2d Platform game - Ladder climbing programming issue
I am in the process of creating my first game which is a very simple remake of the ZX Spectrum game Fred. I have stumbled on my first issue and it relates to the activation of the Box Collider.
To ...
0
votes
1
answer
59
views
Problem when defining a 2d gaussian in zfit
I want to create a custom two dimensional gaussian PDF in Zfit but I thing i am doing it wrong.
class MyG(zfit.pdf.ZPDF):
_N_OBS = 2 # dimension, can be omitted
_PARAMS = ['mean_x', 'std_x', '...
0
votes
0
answers
15
views
Getting remainder of bin dimensions following 2D bin packing outcome
Lets say we are packing smaller rectangles within a larger rectangle. Each time we pack the larger rectangle with smaller rectangles there is some area of the larger rectangle that is not packed. Is ...
0
votes
1
answer
86
views
Sorting 3D points to generate a continuous line
I have a point cloud and I want to sort points clockwise.
I am trying to use this code:
public static List<Point3D> OrderPointsLinearPath(List<Point3D> points)
{
if (points == null || ...
1
vote
1
answer
62
views
Billboarding in Unity 2D
I wanted to make it so a sprite always looks at player but I can't figure out what I am doing wrong.I tried making the player controller as an instance and then using transform to change the vector3 ...
0
votes
1
answer
151
views
camera zoom with lerp(). Godot 2D game
I have a problem. I tried this code:
extends Camera2D
@onready var timer = $Timer
func _process(delta: float) -> void:
zoomi()
func zoomi():
var delta = get_process_delta_time()
var end: float = ...
0
votes
1
answer
116
views
Decompose a rectangle with holes
I have a large rectangle, from which I want to subtract several smaller rectangles. How can I calculate the resulting geometry as a list of rectangles?
EX: In this image, the red rectangle is the ...
-1
votes
1
answer
76
views
Change background image on runtime - Unity 2D [closed]
I need to change background image in unity 2D to a user-specified image while game is runing with C# script. The user will input the image file path.
-3
votes
1
answer
65
views
Is there a way to make sure randomly distributed particles are not within certain intervalls?
I am currently making a simulation of particle movements on a 2d plane of size LxL. I am trying to add obstacles that the particles can not move through.
My problem is with the very first part of the ...
2
votes
1
answer
98
views
How does Rigidbody2D linearVelocity movement meddle with AddForce2D?
I was trying to add a dash mechanics to my 2D game(for a player to dash towards a mouse).
Final dash command looks like this:
Vector2 dashDirection = (mousePosition - rb.position).normalized;
rb....
0
votes
0
answers
35
views
Unity Depth First Search to find where a player can move in a tile based game [duplicate]
I'm creating a tile-based turn-based strategy game, and I'm trying to use a Depth First Search to find every tile a player can move to. The script doesn't have a limit yet but will be added after it ...
0
votes
0
answers
20
views
Referencing a Prefab only being found sometimes when the script is ran
I have a variable (randomPrefab) that is equal to a function that uses a scriptable object to randomly select them from a list in the Resources folder, however sometimes when the game is played in ...
0
votes
0
answers
65
views
Using shaders to create reveal map effect
I am trying to create explored map effect something similar to classic RTS or RPG games where the map is revealed as the player/unit moves across the map.
I am trying out shaders to achieve this, ...
0
votes
1
answer
34
views
Unity - Make Cursor go begind target Sprite
I want to make my cursor go behind a sprite like this:
Is there a way to change the cursor layer renderer in the code / during the game. I want to do it when the character is clicked on.
Right now, I ...
0
votes
1
answer
217
views
Weird artifacts when rendering with Vulkan
So i made a vulkan renderer which uses instanced triangles to render the scene. As you can see in the image below, there are random artifacts all over the screen:
This would be the vertex shader:
#...
4
votes
3
answers
117
views
Sorting/clustering mechanism for determining bounding box intersection
I want to be more efficient in determining intersections between a group of 2D shapes (primitives like lines, arcs). I thought to do this by first checking overlap between their bounding boxes.
Is ...
0
votes
1
answer
44
views
Character specific abilities being applied to all characters?
I'm not great at coding. I know the basics but I'm still learning. Basically I'm working on a 2D platformer akin to Super Meat Boy and I watched a tutorial to create a basic player movement system. ...
0
votes
0
answers
91
views
Issue with card fanning in Godot 4.3
I'm currently following this video tutorial https://www.youtube.com/watch?v=waVOR2ehpuU&t=739s on how to make card fanning, but the result doesn't seems to be correct like in the video. I first ...
1
vote
1
answer
194
views
Determine visible area of TileMapLayer in Godot
I’m playing around with procedurally generated terrain and the new TileMapLayer in Godot 4. Very nice and easy to generate terrain.
I’d like to generate the terrain in the visible area of the ...
0
votes
0
answers
36
views
The scaleX() function in the Konva.js library shifts the coordinates of the Konva.Text() object
I need to recreate an inverted version of an original 2d model side by side.
I can achieve this with scaleX(-1) but the text is upside down.
When I scaleX(-1) again on the inverted model, the ...