xna

3D cubes slowly rendering

时间秒杀一切 提交于 2019-12-11 20:11:48
问题 My previous problem was fixed after I rewrote my block.cs class, however, I have one final problem: I have a list of 256 blocks each with 12 triangles and 36 vertices. When I am rendering these blocks using: blocks.ForEach(block => block.Draw(spriteBatch, camera, effect)); They do render, but the game speed drops intensely, to about 0.25 FPS. Each block has a different texture. Should 3072 triangles and 9216 vertices cause this much of a problem? My render code: public void Render

Moving Platforms in a Tile Map

旧巷老猫 提交于 2019-12-11 19:49:08
问题 I am using a tile map where if a moving platform hits a tile it should go another direction. I am using a list for both the tilemap and platform, this helps keep things neat. The image below shows the platform, it is constantly in motion and when it collides with one of the black circles it should change directions and head the opposite way it was going. Unfortunately I am having a problem where I need to find the correct platform so it will go the other direction. I created the list in the

How to improve/fix collision detection between ball and paddle?

大城市里の小女人 提交于 2019-12-11 19:07:32
问题 Basically i am in the process of making a game which is like pong, breakout, etc. I am having some problems when the ball and paddle collide... but only sometimes! This video here is what is occuring: http://www.youtube.com/watch?v=uFZIxFIg0rI So yea, basically the ball sometimes seems to go a bit crazy when it collides with the paddle... normally if i am moving the paddle in the opposite direction of which the ball is approaching it. Also the ball sometimes get's caught between the bottom of

Error Message when Referencing .dll Files

試著忘記壹切 提交于 2019-12-11 18:56:54
问题 I would like the use DirectInput in my XNA game however I'm having an issue when it comes to referencing the .dll file. I'm using Microsoft Visual Studio C# Express Edition. This is exactly what I do: right click "References" chose "add reference" navigate to the .dll file and hit OK I then receive the following error: As stated above I would like to reference the Microsoft.DirectX.DirectInput namespace but I don't know which .dll file that it's in so I just picked the "d3dref9.dll". Every

2D Water Bump Mapping - Monogame

别来无恙 提交于 2019-12-11 18:45:55
问题 Thanks for taking the time to check out my issue. I am working on improving the ocean in my first attempt at a game. I have decided on a using a bump map against my ocean tiles to add a little texture to the water. To do this, I draw my water tiles to a renderTarget and then apply a pixel shader while drawing the render target to the backbuffer. The problem I am having is that the pixel shader seems to offset or displace the position of render target that is drawn. Observe these two photos:

360 FOV depth buffer by topology and 2D shadows

我的未来我决定 提交于 2019-12-11 18:31:35
问题 in prev question https://stackoverflow.com/questions/32085542/how-to-define-a-matrix-to-transform-2d-plane-into-perspective-360%C2%B0-fov i've asked for a matrix solution for 2D shadows, where depth to the nearest caster is found by all around light. Well, seems its impossible to make such a matrix as i expected. So i've found another method (still does'nt work as expected but very near), and this is the question. First let me explain topology and behaviour: I've defined a background rect

Transferring a list of a list to a 2D array

限于喜欢 提交于 2019-12-11 17:48:45
问题 Ok, so i'm trying to get a 2D array to serialize in an xml file and then be able to load it. The main part works but I have found (possibly false) that you can't use a 2d array in the content pipeline readers and writers. I have replaced the 2d array with a List<List<string>> but I still need the data as a 2d array. This is what I have so far but it throws an null reference exception: TILArray = new string[Width, Height];// I do initialize the array for (int x = 0; x < Width; x++) { for (int

How can i get a fixed position in a window with XNA?

淺唱寂寞╮ 提交于 2019-12-11 17:34:22
问题 I have to show my score in my game but I use 2D camera and when I move the writing "score" remains behind my player. I tried this but it doesn't function ofcr: spriteBatch.DrawString(font, "Score: "+ score, /*param of the position */, Color.Gold); 回答1: I don't understand your problem correctly but: Use SpriteSortMode.BackToFront and render your text as last item. 回答2: From what I can tell, if you pass it a fixed Vector2 position, it should work. If not, it is not a problem related to that

How do I draw a rectangle from one render target onto another without losing data?

一笑奈何 提交于 2019-12-11 17:31:39
问题 I asked a question earlier in the week (here) regarding transferring data from a rendertarget to the CPU so that collisions could be tested on it. From the responses I got there, I decided that drawing a section of the render target to a smaller render target and then retrieving that data would be a valid solution and tried to implement that. After drawing the full sized render target (1280x1024), I switch the active render target to a smaller one (59X47 - the collision size of my players)

Please tell me about this XNA development problem on DELL inspiron !

巧了我就是萌 提交于 2019-12-11 17:16:59
问题 Hello friends i am using Dell Inspiron 1525 with core 2 duo 2.0 GHz processor 4 GB RAM. With this configuration can I develop XNA apps on my laptop? i am having Directx 11 but WDDM 1.0 ? how to update it to WDDM 1.1 ? Thanks in advance 回答1: Download the new driver - like it says in this duplicate post: I am having Directx 11 but WDDM 1.0 ? how to update it to WDDM 1.1? 回答2: The requirements are as documented here. Setup and System Requirements for Windows Phone Emulator Note your display