All Questions
4,847
questions
1
vote
2
answers
1k
views
Java Game how to make image follow line?
Hello I have a game where circles rotate around the centre of the frame. When I click on two circles a line is drawn between the two circles. The circles are always moving and so is the line. I have ...
1
vote
4
answers
4k
views
How to get the closest "visible" object from my "player"?
I'm using Unity 3d and i have to accomplish the following task: get the closest "visible" object to my player in forward direction.
It is a sort of radar.
I don't know where to start.
Any advice ...
1
vote
1
answer
8k
views
Unity2d: orthographic camera and z-axis?
I wonder if anyone can help with an explanation of the z-axis and using unity with 2D with an orthographic camera.
Up until now i have only been modifying the x and y values of game objects, thinking ...
1
vote
1
answer
69
views
Error rendering map android
I'm trying to read this text file and render the corresponding tiles on the screen.
The code for reading the map is as follows:
...
1
vote
1
answer
3k
views
How can I draw many objects on screen instead of just one?
Like many beginner graphics programmers I followed a tutorial which showed me how to set up buffer descriptions and fill out the vertex buffer etc... - the steps involved in drawing a simple indexed ...
1
vote
0
answers
132
views
Cell height with heightmap for collision detection
Hello everyone I'm programming a game with c++ and openGL. My world is generated from a heightmap (100x100 matrix with values 0-255) and now I need a function that returns the actual height based on ...
1
vote
2
answers
2k
views
Update function only running once
For some reason, the update function is only running once. Why does this happen?
...
1
vote
4
answers
949
views
How to order points on a 3D grid such that we can connect them in a line loop correctly
I want to recreate an effect as close as possible to X-Com: Enemy Unkown's movement range feedback:
(source: gameinformer.com)
The blue line delimits the tiles which the soldier can reach using a ...
1
vote
2
answers
2k
views
Stop rendering hidden objects libgdx
I currently am hiding objects that are not in the frustums view.
However, some objects are still being rendered that are in the frustums view, but are hidden. My goal is to not render objects that won'...
1
vote
2
answers
185
views
Unity2D - Save everything in a scene before loading another and come back to it?
So I have am into this endless runner thing where everything is generated randomly from prefabs. Okay cool! But I am currently working on a bonus collectible which takes the player to another scene. ...
1
vote
1
answer
1k
views
Unity Mathf.Atan2 algorithm complexity
using Unity5.5.1f;
using C#;
So I have a circle (2D) divided equally by 16 directions, and I also have a direction V which is different from the other 16.
In order to know which direction is the ...
1
vote
2
answers
2k
views
Swap buttons in layout
Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly.
So, when the user taps button 2, it should swap with another button (randomly).
Now, ...
1
vote
2
answers
4k
views
Design Pattern for card game objects
In my game, I will have more than 100 types of cards,
and before the actual game, player can select 6 of them and will be shown as 6 buttons on the scene.
The card have its own ID, card name, and a 3D ...
1
vote
1
answer
6k
views
How to create scrolling input text field using Unity UI
How to create scrolling input textfield using UI
in Unity 4.6.6
problems in my project are
1.Cursor is not masking
2.Scrollbar size is automatically become 0 to 1 size
3.Scrollbar is not working ...
1
vote
0
answers
394
views
How to iterate over 25 Sprite Objects (Unity 5 - C#)
I wanna show a minimap on the screen. The minimap would look like this (bottom right corner, this was done time ago in Visual Studio):
Have two problems with that, I have 25 Image objects created in ...
1
vote
1
answer
209
views
Unity2D: Frost Effect Time scale
I downloaded this package ("Frost Effect by Steven Craeynest") on Unity Asset Store and altered it into making the effect happen once I click on a button (button 1), I first disabled the frost button (...
1
vote
1
answer
612
views
AI and EntitySystem
I'm using an Entity-Component System and have an AI System that acts on certain entities (agents) within the system. My question is: how should the AI system interact with the world and the agents? I'...
1
vote
1
answer
291
views
How to understand kind of matrix/world from implemented math operations?
i'm a newbie in 3d programming, and i approach for the first time this argument.
I try to make some changes to an existing 3d object viewer, to better suite my needs. This object viewer is jsc3d.
I ...
1
vote
1
answer
176
views
Why my game is running slowly if it was launched from a wpf application?
i have some issues why my GameEditor. I would start my XNA project from it, like a debug-client. It opens and all works fine, but it runs on 45 frames until I hide the wpf form. then the framerate ...
1
vote
0
answers
242
views
Moving the rendered object/the projection perspectives based on an AR marker
I saw this video and now I am trying to making it.
I have used Vuforia AR Camera Pulgin, and so far tracked the image on a marker but the problem is getting the four projections of the 3D object on a ...
1
vote
1
answer
3k
views
How does one make both movement and animation to sync up and happen simultaneously?
I am very new to Unity and game making and would appreciate if you would cope with me.
I have made a very basic prototype of character animation and movement, however trigger that is supposed to fire ...
1
vote
1
answer
3k
views
Unity ball not bouncing off wall correctly
I have been making a brick breaker game in Unity in 2D as my first game. I have got the ball bouncing off the paddle correctly and can bounce it of the paddle at different angles. However, when the ...
1
vote
1
answer
1k
views
How can I implement "cut outs" for lighting in OpenGL?
So, I'm working with OpenGL (I'm not exactly sure of the version), and I want to do an old-style lighting setup by essentially drawing a black rectangle over the screen, and drawing white circles over ...
1
vote
1
answer
866
views
LOVE Physics - Breaking Joint Chains (LUA / Box2D)
Wasn't sure whether to post here or on SO so please move if needed.
I've been having a look into the box2D physics API provided by LOVE to try and create a swinging flail or weighted rope but I'm ...
1
vote
2
answers
1k
views
Procedural terrain generation in cylindrical (2D) world
I'm fairly new to procedural terrain generation. I know that to generate terrain you would use different calculations with the x and y axis (also z if you have one).
But what if you want to generated ...
1
vote
1
answer
2k
views
XNA 4.0 - Mixing 3D and 2D - SpriteBatch putting weird alpha texture over whole scene
I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD.
I have tried doing a simple test using spriteBatch as such:
...
1
vote
2
answers
3k
views
How should I implement card effects in a card game?
I've been trying to program a video game adaptation of the popular trading card game "Magic: The Gathering". If you've played MTG before, you'll know most cards have an effect, which is activated at a ...
1
vote
2
answers
993
views
Why doesn't Unity keep keydown states between scenes, and how can I change that?
So basically, when my scene in Unity changes and I'm holding down, say, Right or Left, when the scene resets, my player (and Unity) doesn't even recognize that I'm still holding that button, until I ...
1
vote
0
answers
2k
views
Unity IAP through Google Play is forgotten after a day without internet connection
I am trying to make a NonConsumable IAP purchase persist without internet connection.
I have implemented the IAP system from Unity 5.6 through Google Play for a NonConsumable item and it is working. ...
1
vote
1
answer
3k
views
Throwing a grabbed object
I'm trying to throw the carried object in the direction of the first person controller, but unable to make it. I could make the carried object drop, but the same time i need to instantiate velocity to ...
1
vote
2
answers
949
views
How would I check the range against the entirety of an enemy object, and not just it's transform.position?
I want to be able to do range checks against the entirety of an enemy object, and not just it's transform.position. The enemy object can have it's side or nose within range, but range detection will ...
1
vote
1
answer
426
views
Am I allowed to release a fan-made version of a Trading Card Game on a fansite? [duplicate]
Consider a Trading Card Game that is currently available for play in digital format only, the game in question would be HEX: Shards of Fate, but this question is intended as a general question about ...
1
vote
1
answer
93
views
onClickListeners not working correctly (conflicting)
In my pause dialog, the exit is working correctly, but the resume isn't, if I press resume 3 times, the third time it's going to exit.
...
1
vote
0
answers
484
views
Cocos2d-x: Differences between applying shader to child node and entire scene?
I'm beginning with shader.
I wonder what if i apply shader for single node, what'll happen?
The gl_FragCoord = (0.5,0.5) is the bottom left of the screen or the ...
1
vote
1
answer
212
views
Different screen sizes?
I have looked through all of the android docs and many stack overflow questions, and I have a question on supporting multiple screen sizes. If I have some drawables, I know I need to put them in ...
1
vote
3
answers
431
views
Calculate intersect point / aim point
I'm working on a simple game, and I need to calculate the position to aim.
Since my math days are a bit behind me, I put together a simple example to illustrate:
So given that I know the position of ...
1
vote
2
answers
3k
views
Create a body of an irregular 2D sprite in Farseer
I'm trying to create a body of a irregular 2D sprite Farseer 3.3.1.
The regular shapes that BodyFactory provides are not that I want. Is there a way that one can ...
1
vote
2
answers
6k
views
locking a rotation on an axis(yaw/pitch/roll) based on a parental transform
I am currently attempting to lock a non rigid body transform rotation around on an axis. It is parented to a gameobject that is rotating in 3D space. I want the
Original transform to have the same ...
1
vote
0
answers
130
views
Aron Granbergs Unity Pathfinding AI goes back and forth
The agent goes back and forth after calculating the path with seeker.StartPath (transform.position,target.transform.position, OnPathComplete);. The gizmo shows the ...
1
vote
2
answers
3k
views
XNA advanced rotation 3D
I'm able to rotate any model with any angle I want, where I can not rotate my model around a given point.
e.g: My model rotates from the origin assigned in its .fpx file. I want it to rotate related ...
1
vote
2
answers
841
views
How to create old-school format music with small file sizes
My friend and I have been working on a project recently, and because we are hard coding everything (other than the graphics library, Pygame), the total size for our project is super small. I feel like ...
1
vote
1
answer
2k
views
How do you convert angle with velocity to x velocity and y velocity?
This question can be simplified to: If you lean a pencil of a certain length at a certain angle what is the x and y position of the tip?
So, basically, I am making a game that plots a balls path ...
1
vote
5
answers
3k
views
Why would a game developer choose Direct3D instead of something with more cross-platform support?
Why would a game developer choose to use Direct3D (D3D), instead of using something with more cross-platform support, like the Vulkan or OpenGL APIs?
I know the hardware is actually rendering.
1
vote
2
answers
103
views
Updating bots/AI behavior after a fixed elapsed timestamp in game loop?
I am developing a HTML5 game in javascript. Now I have created a few bots and they should be able to change their orientation after a few seconds/a fixed timestamp in the game loop.
Suppose my game ...
1
vote
2
answers
375
views
How can I detect a perfect passageway for collision detection?
The problem is when I move diagonal it moves fractions of units and therefore my coordinates might be a fraction of a unit say (40,400) might be actually (40.12,400.40) but another problem is my pink ...
1
vote
1
answer
500
views
XNA game publishing help with incompatibilities via content built at runtime
MY XNA game is finally complete, but I'm having difficulty getting it to run on other Windows computers. I've read similar other stackexchange topics here, here, and here, but I'm still gonna need ...
1
vote
3
answers
10k
views
How to import or "using" a custom class in Unity script?
I have downloaded the JSONObject plugin for parsing JSON in Unity but when I use it in a script I get an error indicating JSONObject cannot be found. My question is how do I use a custom object class ...
1
vote
2
answers
314
views
How do I determine if I'm allowed to use an asset from the web in my game?
I need to incorporate other people's work into my game project. I must admit (with a little embarassment) that I am almost completely ignorant about copyright. I only have a vague idea of what it is, ...
1
vote
2
answers
386
views
How do i calc what side the ball is of the rect?
I have this nice drawing:
http://bildr.no/view/1085283
I know the ball's center and the rectangle's center, but how do I know (programming C#) what side of the rectangle the ball is?
By my drawing, ...
1
vote
2
answers
554
views
How to get the result of random item with different possibility? [duplicate]
I'm wondering if anyone can guide me with following problem...
Each fruit has different chance to be called out.
Apple - 80%
Orange - 10%
Banana - 10%
Each time ...