Questions tagged [xna]
XNA is a game framework by Microsoft that allows deployment for Windows, Windows Phone & Xbox 360.
3,078 questions
1
vote
0
answers
197
views
Jump height being affected by the duration of how long jump button is pressed
So I've been trying to implement a controlled jump the way the title proclaims to make the game easier to play and having the ability to make harder challenges in each level. I have noticed how there ...
3
votes
1
answer
332
views
How to create shockwave of objects in other shapes than circle?
Basically, I'm making a bullethell / I wanna be the guy inspired game for where I'm currently creating different methods of spawning bullets into the game. One of the few methods I've created is ...
2
votes
1
answer
4k
views
Correctly creating/handling events for keypress in MonoGame C#
I'm having trouble finding the best approach to registering an instantaneous user key-press with MonoGame (where the key has been held down and then released), using events in C#. Unlike the click of ...
1
vote
1
answer
226
views
Drawing on an image before drawing on screen in XNA using VB.NET
I'm programming a game in XNA, using VB.NET. I want to create an intro to the game that zooms in/out the whole screen and scaling each image to accomplish this is cumbersome at best. I like to be able ...
1
vote
1
answer
446
views
XNA - SoundEffect with SpeedOfSound
SoundEffect has SpeedOfSound property. I'm trying to use it, but it doesn't work:
...
0
votes
1
answer
256
views
XNA HLSL Shader Color Swapping based on lightness
I'm trying to achieve a similar effect to the image below in HLSL.
[Ignore the inbetween state, currently I'm only trying to achieve the final phase, which is black and red]
What I tried so far is to ...
0
votes
2
answers
515
views
MonoGame Gamepad Y axis flipped?
I'm following a book I bought on Google Play that is teaching me the ropes of MonoGame, and in Chapter 2 it introduces creating an input wrapper that takes care of all the input methods for a game pad ...
0
votes
1
answer
212
views
Gaussian blur spritesheet/texture atlas without clipping edges
I'm trying to apply a Gaussian blur to a shadow to soften them a bit. I can apply the blur fine, but the problem is that I end up with this:
Instead of this:
Which isn't great. The image is part of a ...
0
votes
1
answer
300
views
How can I use web browser controls for non-browser game GUI? [duplicate]
I'm looking for a way to get a modern browser's level of customization and rendering quality in my c# monogame to avoid using roundabout/limited/buggy GUI toolkits and to get better fonts without ...
2
votes
1
answer
2k
views
XNA/MonoGame screen scale and keeping aspect
My aim is to make a simple 2D platformer, the idea is that it will be a base resolution of 480x270 (16:9) which can scale x2, x4(1920x1080) or go full screen.
I basically do:
graphics....
0
votes
2
answers
380
views
Lerp velocity in specific time
How to lerp velocity to 0 in specific time? For example in two seconds? I need this for jumping.
velocity.Y = MathHelper.Lerp(velocity.Y, 0, [time]);
0
votes
2
answers
246
views
C# XNA :Snake Game, direction problem
I am trying to do a snake game in XNA but I have some little problems...
I explain :
The Snake has a direction (Enum Type : Haut(=up), Bas(=down), Droite(=right), Gauche(=left))
When the player ...
1
vote
2
answers
1k
views
HLSL texture not reading from register S1
I made a simple post processing shader, that draws scanlines. This all works perfectly. I wanted to make it a bit more interesting by applying a shadowmask instead so I wanted to pass a texture to the ...
3
votes
2
answers
2k
views
How can I use an HLSL pixel shader to peek at other pixels?
I think this is like a pixilation shader but I had a hard time trying to find one online, and one that I could manipulate specifically.
I want to create a pixel shader for my monogame project that ...
0
votes
1
answer
97
views
Is Update(GameTime) called before it's finished?
Code at the beginning of Update(GameTime) is being called over and over again, and code at the end of Update(GameTime) is only ...
0
votes
0
answers
167
views
XNA Access violation from KernelSoundEffectInstance
Some users (but not all) are reporting a periodic crash in my XNA game. They say it's happening every 15 to 20 minutes. I am unable to replicate this myself, so I asked users to send me error logs.
...
-1
votes
2
answers
612
views
How do I create a 3rd person camera in XNA?
Because other people are using too complicated code for me to understand, I decided to ask a question from an XNA noob. So, I'm using the spaceship thing that Microsoft use in their tutorials of Going ...
0
votes
2
answers
93
views
How to achieve a sheet of paper unfolding from the center in XNA 2D?
I need to create an effect like a folded sheet of paper unfolding.
I was thinking about transforming an image so it "scales" from the center to the borders by cutting the image in half and scaling ...
1
vote
0
answers
276
views
Monogame + Render Target + antialiasing doesn't work
Is there any proper way to use antialiasing, while rendering to a RenderTarget2D and using Monogame?
I do this:
...
4
votes
1
answer
736
views
Can I use xna tutorials to learn monogame?
Can I use xna tutorials to learn monogame? I can't find any good monogame tutorials but there are tons of xna tutorials available and from what I have seen they are pretty much the same thing.
1
vote
2
answers
197
views
How to load textures at other times than startup in XNA using vb.net?
I've encountered a problem with my game project lately. When I load more than a certain number of textures (around 1000) at startup I recieve an error regarding memory, because I have to use 32-bit in ...
2
votes
3
answers
10k
views
Monogame - Sprite sheet animation
I have a sprite sheet that contains a character walk cycle, and I have made a player class that allows the player to move and cycle through the walk animation, however the animation only works whilst ...
0
votes
2
answers
2k
views
Smooth movement from point A to point B in a tile-based game
I'm currently very new to XNA, and I'm trying to get a grasp on movement. Currently, I have a function that checks for keypresses, and moves my character from point A to point B instantly:
...
2
votes
2
answers
594
views
Why does transforming a Vector3 by a Quaternion result in reversed Z?
I'm trying to transform the vector (1, 0, 0) by an orientation unit quaternion, which in XNA should be:
Vector3 v = Vector3.Transform(Vector3.Right, Orientation);
...
0
votes
1
answer
188
views
Game crashes when sound is finished
I'm trying to code a simple audio playback test game (which will be used in my actual project), and everything works fine, except for the fact that after the audio has finished playing, the game will ...
0
votes
0
answers
312
views
Water reflection xna
I'm actually trying to do the reflection map for my water component, but even following the riemer's tutorial about reflection map the formulas provided doens't work. http://www.riemers.net/eng/...
1
vote
1
answer
2k
views
Drawing textures in 3D/2.5D at an angle using spriteBatch in Monogame
for a university project we are creating a small "2d" game. Im writing 2D in "" because we would like to achieve a look similiar to the one in games like Don't Starve (so more like 2.5D).
As you ...
0
votes
3
answers
839
views
How do I draw non-smoothed fonts in MonoGame 3.5?
I don't want to smooth the tiny fonts I'm building but even disabling ClearType system wide doesn't let me create SpriteFont files with sharp characters. There doesn't seem to be an option for ...
0
votes
0
answers
91
views
Purple screen when using vertex shaders
Alright, so I've tried everything I can think of. I've put in over 10 hours into this crap, but nothing seems to work (tried multiple online tutorials as well). Always purple screen.
Here is the ...
0
votes
2
answers
758
views
XNA/MonoGame creating a player
After some fine-tuning on my game's GUI I am finally ready to begin with the gameplay. But that's a tall order. My game will be something like a 2D platformer with RPG elements like collecting armor, ...
0
votes
1
answer
2k
views
XNA How do I detect if my mouse if hovering over a specific sprite?
How do I detect if my mouse if hovering over a specific sprite?
For example I'm making a custom button and I want to check if my mouse is hovering over it so I can make animations.
2
votes
1
answer
728
views
Having trouble creating multiple sprites from one class
So I am trying to make more than one sprite using a single class but I cannot seem to get the sprites to be drawn at all or drawn in different places (they are all just on top of one another).
In my ...
0
votes
1
answer
726
views
Using XNA to create an isometric tileset?
In XNA, how can I take any given texture, then render it so that it fits completely into a 64x31 (or 32x15) isometric tile such that it tessellates perfectly? My goal is to give various textures to my ...
0
votes
1
answer
1k
views
Draw a Texture to fit a rectangle
I would like to draw a texture in a rectangle that is smaller than the texture, normally the texture will be scaled to fill the rectangle, which results in a squished image. I want to draw it to fit.
...
2
votes
1
answer
187
views
Ray casting fails when it shouldn't
I have two objects that should collide. My player should stand on a ship. The position where my player stands, is exactly on the edge of two adjacent triangles (in the ship's model). To Check for ...
0
votes
1
answer
665
views
Transform matrix hierarchy issue
I'm trying to implement a parent child relationship between Sprites and draw them to the screen. I'm calculating transforms by chaining transform matrices.
I'm using code from here:
...
0
votes
2
answers
2k
views
Using sourceRect or cropping out a Texture 2D to draw? MonoGame/XNA
I was wondering what is the best way to draw textures (for performance). Using the sourceRectange in the spriteBatch.Draw() call and just draw the whole spriteSheet, or crop out every texture on the ...
4
votes
2
answers
2k
views
2D Platformer AABB collision issues
Before anyone say that this questions already has a answer, I will list all the questions I read and tried:
AABB collision resolution issues
Trouble with AABB collision response and physics
https://...
5
votes
1
answer
2k
views
How to do Chromatic Aberration on a transparent background?
I have a problem with a chromatic aberration shader effect...
If I produce the effect on a white background I get exactly what I want:
But if I do the same effect on a transparent background I get ...
6
votes
1
answer
189
views
transfer 3d model processing from Xna to Android?
I developed an XNA scenario in a desktop application and I need to make the same scenario in an Android app so I need to process data on the desktop computer and just display it in Android app using ...
-1
votes
1
answer
241
views
Bullet only removing closest enemy
I'm having an issue with my collision detection code. I'm making a top down shooter and when I shoot, the bullet will only destroy an enemy if it's the closest enemy. The bullet will go right through ...
1
vote
1
answer
323
views
Check collision with rectangle and pixels
I have done a function to check the pixels collision against two animated sprites, and now I need to check a "Rectangle x animated sprite" collision, but I have no ...
0
votes
1
answer
823
views
Mode 7 in xna/monogame
I want achieve a view like Mode 7 from snes games where the closer textures get stretched out more and more far away textures look smaller. Something like this:
What I have in my project at the moment ...
2
votes
1
answer
457
views
How to fix my camera collision, C# XNA
I am having some weird issues with my camera. I am trying to make it so it is a first person camera, that when the user presses the W or Up key, it moves towards where the camera is looking. My issue ...
0
votes
2
answers
454
views
Is it possible to trigger a loop with key input
Ok I need to know if it is possible to trigger a gameloop with a key press?
ex code
...
0
votes
2
answers
1k
views
XNA's GameTime.ElapsedGameTime.TotalSeconds isn't working as expected
As I've seen at quite a few website, the best way to handle variable frame rate and movement (moving projectiles, monsters, swinging swords)... looks something like this:
...
1
vote
1
answer
839
views
How do I make 2 players from one Class?
I am teaching myself XNA and only started a few days ago. I am making a clone of Pong and have made a class for the Paddle:
I am wondering how I can create 2 paddles one for each player from the one ...
0
votes
2
answers
362
views
Best way to draw 2D shapes on a 3D flat object
I want to draw shapes (arcs, circles, lines) on a table, which is in 3D space. The table top is at Y=0 level and oriented so it points to (0, 1, 0). There are some other 3D objects on the table, so ...
1
vote
1
answer
209
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 ...
0
votes
2
answers
704
views
Calculate ticks for animation delay
Hi guys I am trying to calculate the correct elapsedTime for each frame in my animation.
Example I have a sprite called stance that has 20 frames I want to give each frame a tick delay property that ...