Questions tagged [game-development]
Questions directly related to programming computer gaming and interactive graphics/video. Questions involving game logic or general game development (which are off-topic here) should be asked at https://gamedev.stackexchange.com/
3,236
questions
0
votes
1
answer
21
views
Creating abstract enemy state machines in Unity3D
I'm trying to implement a reusable finite state machine for enemy behaviors in my game and am struggling to figure out how to pass derived classes as parameters. Below are the two base template ...
0
votes
0
answers
16
views
Connect-four Minimax algorithm recursion
I'm working on making a Connect-four game where the AI is the minimax algorithm.
I'm stuck at the point where if depth == 0, the function just calls itself to the infinite and I have no clue what to ...
0
votes
0
answers
13
views
How do I calculate the texture direction using UV data in the Lithtech Jupiter engine?
I am trying to reverse engineer the level files for the video game Tron 2.0, and I need help from someone who is either good at Math and/or familiar with Lithtech.
Long story short, I am having ...
-4
votes
0
answers
20
views
Unity 2d, overturned top part turret when rotating top part of turret when aim to enemy [closed]
I would like to make 2d tower defense game. But I got this problem when make turret script. Could some one teach me how do I fix this problem? Problem picture and code is below.
Normal var
Overturned ...
-2
votes
0
answers
16
views
how do i code a flashlight for a unity game without a firstperson controller [closed]
Hi so I'm making a unity game and every tutorial I watch tells me to go to the first person controller yet I don't have one. Maybe because I'm using a first person template? Do I have to make a new ...
0
votes
0
answers
46
views
How to optimize both encapsulation and compilation times in C++
OK, so what I'm trying to do is optimizing the compilation times for my C++ project.
I'm not interested in obvious techniques like header guards/#pragma once, favoring fwd declarations when possible ...
0
votes
0
answers
7
views
What is the difference between P2P and Client-Server where one client is also the server?
I'd like to implement online multiplayer in a small game I've written just for learning purposes. I'm starting to research about which network architecture, protocols and such is the best fit for my ...
0
votes
0
answers
17
views
Changing sprite texture isnt working in godot (C#)
I'm making a simple Whack-a-Mole game, and I'm making a simple texture change for whenever you hit moles. But it doesn't seem to work properly, there are no errors, but the texture isn't changing.
The ...
0
votes
0
answers
10
views
How to set the maximum available "refresh rate" (Not target frame rate) for mobile device?
I have set application.targetframrate = 60.
When I built the apk and installed it in other devices, it worked well with full fps.
But for my device it lowered the fps.
I figured out that my device &...
-1
votes
0
answers
25
views
Unity crashes in Unity Editor but runs fine as built application
When I run the game, it loads fine. But as soon as I start to swap pieces Unity crashes and the project closes immediately.
This happens after clicking on one piece, then dragging it to another place ...
-2
votes
0
answers
33
views
why my ai car is rotating around the second node of the path, please help me fix this
`i am making a car racing game project and have been trying to build ai system for the car. I made the path to follow with 35 nodes but the car is stuck at the second node and rotating around it.
Here'...
0
votes
1
answer
14
views
How to assign the Rigidbody2DbodyType by reading a saved string in a txt file?
I am writing the bodyType of the assetsToSave gameObjects into the txt file which works perfectly
assetBodyType[j] = assetsToSave[j].GetComponent<Rigidbody2D>
().bodyType.ToString();
In my ...
1
vote
0
answers
21
views
How can I have multiple forces act on an entity in Bevy?
I'm making a game in rust, in Bevy with Rapier2d physics. I want to apply forces to the entities from different functions (systems).
How is multiple external forces added to entities?
-1
votes
0
answers
16
views
Cannot include SDL.h in Visual Studio Code [duplicate]
I am new to C++ and SDL2 and I'm trying to include SDL.h into my main.cpp in VSCode, but I get the following error even though SDL.h is in fact in src/include/SDL2:
main.cpp:1:17: fatal error: SDL.h: ...
1
vote
1
answer
33
views
How to update HTML elements in Svelte and Sveltekit via onMount
I am down with Covid and wanted to write a fun little game. I am writing a Hangman Game in Svelte and Sveltekit.
I have most of the game written, but I a stuck revealing the divs of the hangman.
Here ...
-1
votes
0
answers
38
views
How to go about movement in tactical RPG games akin to Fire Emblem games? [closed]
Fire Emblem is a tactical rpg where characters move across a grid. Each cell in this grid has a movement cost, depending on the character's class. For example, a cavalier unit (rides on a horse) tries ...
0
votes
1
answer
24
views
I am struggling to - smoothly - skip forward in a playing video
Unity Game Engine
I have a video of a character jumping forward in multiple steps.
Until now, I have a semi-functioning C# script with a long paragraph of IF/ELSE statemens, skipping through a ...
-1
votes
0
answers
23
views
I'm making game by VS Studio with Window Form Application. Now I need to press KeyDown one time to attack
I'm student and now I'm doing the Mini Project by VS studio and Window Form Application. Now I need to hold key but need it'll work one time to player attack.
need to hold key but it'll work once time....
0
votes
1
answer
19
views
How to Get Value of a GradientTexture2d
I am trying to make a procedurally generated island. I think I am almost finished with actual terrain generation part using OpenSimplex noise, only thing left is making it into a island surrounded by ...
0
votes
0
answers
19
views
Starting idea to program the game Hive (Java) [closed]
I'm in the second semester of my computer science degree and have to program a game in Java. My idea was to program the board game "hive" but I don't know exactly how to start with it. ...
-4
votes
0
answers
18
views
Sprinting and Stamina System in Pygame [closed]
I am making a 2D survival game in pygame and I want to add a sprinting system to my game. I have got the main features down such as movement. I want to make it such that when you press shift and you ...
0
votes
0
answers
8
views
Gamemaker studio: My enemies jump out of the room but only when they collide with the left wall
My jumping enemies jump out of the room. They collide with the right wall and bounce off correctly. however when they collide with a left wall they jump out of the room and fall out. Please help. ...
0
votes
0
answers
75
views
Diamond isometric map - click tile detection - using a formula derived from a matrix using corners
Trying to pick a tile on an isometric diamond shaped map.
I have a formula that translates cell to screen coordinates based on it corners.
screen.X = cell.I * 0.5 * TILE_WIDTH + cell.J * -0.5 * ...
0
votes
1
answer
21
views
Script is working even disabling it in the play mode
Here's the screen recording of the issue:
https://youtu.be/WnFuhhiBS7M
There are 2 players. Each have player script on them. That script is responsible for the jump function.
Now when I play the game ...
-1
votes
0
answers
51
views
How do you simulate a realistic jump in C++ [closed]
I am currently trying to make a Doodle-Jump game in C++ without SFML and I don't know how to simulate the jump in the actual game because there the jump is not constant and is not linear and from what ...
1
vote
2
answers
19
views
Issue using sprite, extra margin in character sprite
when i load player character in Phaser.js using matter physics there's a extra margin. Is there a way to remove it using Phaser.js or i will need to update the image directly.
-1
votes
0
answers
43
views
(SOLVED) Difficulties with function's arguments
i am asking for help with an issue that occurred during the testing of this code. That's a program that simulates a simple card game (all rules are written in the code). The problem that i have is ...
0
votes
1
answer
69
views
Mathf.Clamp() for angles in Unity
I'm working on a 2D platformer game in Unity. I have a GunController script that controls the angle of the player's gun:
Script:
using UnityEngine;
using UnityEngine.InputSystem;
public class ...
0
votes
1
answer
20
views
How can I see and edit the fields of the scriptable object in the inspector of the same script where I set reference to it?
After creating an asset object in the assets folder of a scriptable object class, we can see and edit the values of the fields of that scriptable object. Then we can reference that object in different ...
-2
votes
2
answers
45
views
Please help me solve the problem c# unity 2d [closed]
i asked chat gpt to create an attack script for me and it came up with this but it throws an error
The type or namespace name 'Enemy' could not be found (are you missing a using directive or an ...
0
votes
1
answer
46
views
Change Color of a public GameObject in script [Unity]
I created a gameobject call archor, it has a script attached to it, that script refers to a gameobject (e.g. Wall) through
public GameObject Wall (in code)
Then I drag a prefab from Unity Editor into ...
0
votes
0
answers
21
views
Parent rigidbody uses child rigidbody to jump (but it shouldn't)
So here is what I'm trying to do:
This is a 2D game-
Player A and B, both can jump individually using their own rigidbody2d. But when player B jumps on top of player A, it becomes a child of Player A. ...
-2
votes
0
answers
36
views
How would I make my HTML game of snakes and ladders allow two players to play the game together online? [closed]
This is for a university project.
I have written the code for the game itself and it currently has two modes, one where you can play against a computer player and another where you are playing locally....
0
votes
0
answers
24
views
How to scale game on different orientations and screens
I am trying to scale my game on different orientations( landscape and portrait ) but I face problems in keeping the game out of bugs, I am using javascript and mainly phaser.
I am trying to find a ...
0
votes
0
answers
18
views
Update database on change vs batch-update in specified time intervals [closed]
I'm developing a CCG game. On serverside, I hold every single user's game data on a list of user objects. The said user object holds data like war points, gold owned, player stats etc.
After each ...
2
votes
3
answers
68
views
Why doesn't my function for scoring tiles in an array not work?
I'm writing a small roguelike game for my university programming project. I wanted to try implementing a simple pathfinding mechanism, which would involve filling the tilemap with numbers going ...
0
votes
0
answers
18
views
Unity game scene won't load and is stuck loading, even when contents are copied to another scene [closed]
I'm encountering an issue in Unity where a game scene gets stuck on a loading screen and won't play when I run it. I have tried copying the contents of the scene to a new one, but the problem persists....
0
votes
0
answers
14
views
Game times out on start page using p5.js and p5.play [closed]
I am working on a simple game like the Google T-Rex game, and I have a start page as well as a few slides of background info that you click through. The problem is, if you stay for more than ~5 ...
-1
votes
0
answers
32
views
javafx animation comes in delay
I'm building a connect4 game using javafx (fxml and controller). I have a method that gets notified when the board in the model is changed. The problem is that my animation is playing and shown only ...
1
vote
1
answer
28
views
Why is the object scale not being retained in Unity?
I'm trying to write a function that can scale a 3D shape in any direction. This function is attached to an object and will be enabled when the object is grabbed by the player. After the script is ...
0
votes
1
answer
12
views
Getting Smooth Rotation Acceleration in UE5 - Use Lerp?
I'm currently writing a basic PlayerController for a Spacecraft Pawn in UE5 (C++, not Blueprint). It's all going well and I've managed to get decent-looking pitch roll and yaw without gimbal lock.
I ...
0
votes
2
answers
41
views
Changing TMP text
I'm making a ui which has 4 spell slots. I made it so that when my player collides with a tome gameobject, it gets added to my player's unequippedSpells array which is in my SpellSystem script.
...
0
votes
1
answer
26
views
2D infinite procedural world generation
I am working on a falling sand game and now I am trying to make my world infinite like minecraft.
and to do that I figured that I need to make a world class to store all of the chunks that will be ...
-1
votes
0
answers
13
views
Is it possible to display a Python program merged with another website? [closed]
I'm creating an interactive story/game in Python, and I want to make it so that this 'game' can be viewed and played in my own private website. Is there a way to do this such that I can merge the game ...
-1
votes
1
answer
30
views
Character wont move more than 1 frame in unity [closed]
I am trying to make a 2d game in unity and I cannot figure out why my character sprite will only move one frame then no more, for instance if I move up it will be above where it started but if I then ...
0
votes
0
answers
24
views
Ingame Timer Doesnt Restart Counting after its counted till limit once
I am creating a quiz game that has a timer for every question.I tried to create a script that counts down from 20 to 0 and after that the game shows the correct answer with a soundeffect and then goes ...
-2
votes
1
answer
24
views
How can I develop games for Android Auto that can be played on car screens? [closed]
I am trying to create games that can be played on car screens via Android Auto. However, I could not find any examples or resources online. I have experience in developing Android applications, but I ...
0
votes
0
answers
33
views
Is there a way to allow any changes that occur during a collision in Pygame to remain in the updated state after the collision is over? [duplicate]
I am working on a game which relies on the collision of two objects in order for the game to run. However, I have noticed that rather than the collision only occurring once, it occurs an infinite ...
-1
votes
1
answer
35
views
location of the object is changing, but no visible changes Unreal 5.1 c++ [closed]
I want to move my object.
When I start game, I can see that location in properties of object changes, but there is no visible changes on the screen. If I change location manually it's moving.
name of ...
0
votes
1
answer
56
views
How can I get the pathes between two nodes in a grid?
I would like to make a function, which can give the coordinates of the possible pathes between two elements in a simple matrix. Until now, I have managed to determine, whether there could be a path ...