xna-4.0

how to show lots of sprites from one texture and have them move at intervals XNA 4.0

五迷三道 提交于 2019-12-23 01:46:39
问题 Hi I'm new to xna and I'm trying to make a simple game where your a little ship that moves around and avoids asteroids that fall down from the top to the bottom. I've got the ship moving and one asteroid falling but I don't know how to get lots of asteroids falling from the same texture and how to get them falling at intervals. This is my asteroids class so far: namespace Asteroids { class Asteroids { Texture2D AsteroidTexture; Vector2 Position; Random random = new Random(); float

Can't access build configuration manager or build configurations in Visual C# 2010 Express

自古美人都是妖i 提交于 2019-12-22 05:17:05
问题 Full Story Typically, when I install Visual C# 2010 Express, the first thing that I do is switch to Expert Settings. That gives me access to build configurations, and the respective manager. This most recent installation seems to be misbehaving. The first project that I created was an XNA 4.0 (Refresh) project. I imported some old code, switched to Expert Settings, and confirmed that I was able to access both the build configuration manager and the build configuration toolbar. However, when I

Stencil testing in XNA 4

不打扰是莪最后的温柔 提交于 2019-12-22 00:12:54
问题 I was able to do this in XNA 3.1, however I see that we now use state objects in XNA 4, which is certainly an improvement, although I can't accomplish what I want so far :) I am trying to: Clear the stencil buffer to 0. Draw a texture to the stencil buffer, setting the stencil buffer to 1 where the texture is drawn. Draw another texture that will only appear where the stencil buffer is not 1. Here is what I have so far, which appears to have no effect on the drawing of texture 2: BlendState

Create Rounded Rectangle Texture2D

南楼画角 提交于 2019-12-21 19:50:10
问题 I am building a game with dialog boxes, and I would like to be able to procedurally generate textures for the boxes, in a very similar style to that of the Final Fantasy Series (think like Final Fantasy VII). Here is a code snippet of what I have so far: public class DialogBox { public Rectangle BoxArea { get; set; } public List<Color> BoxColors { get; set; } public List<Color> BorderColors { get; set; } public int BorderThickness { get; set; } public int BorderRadius { get; set; } private

How is L-systems for road networks modified?

て烟熏妆下的殇ゞ 提交于 2019-12-21 00:28:09
问题 Greetings each and all! I'm currently looking into procedural generation of a road network and stumbled upon the L-system algorithm. From what I understand from various scientific papers on the subject, and further papers on the papers on the subject, the algorithm is changed to use "global goals and local constraints", in which the taken path is modified to fit input values such as terrain and population density. Now that part I understand, or atleast the overall concept, but how am I

XNA 4.0 cannot create an AudioEngine

我是研究僧i 提交于 2019-12-20 05:50:55
问题 This question is a derivative of this one: Creating XNA AudioEngine on windows game project I am working from the same book, and have the same problem as the original question. The solution provided by Andrew doesn't work as doesn't exist as well. I am unable to use AudioEngine class in my project. I have tried adding this using statement: using Microsoft.Xna.Framework.Xact; I'm not sure what to do. 回答1: Make sure you have the reference to Microsoft.Xna.Framework.Xact.dll In Visual Studio, in

Depth Buffer not working

一曲冷凌霜 提交于 2019-12-14 03:24:46
问题 In my XNA 3D game, for some reason, the depth buffer is off and ignored - even though I've done everything I can find to enable it (which admittedly isn't much, but it's supposed to be simple... not to mention default) Before the models are rendered: global.GraphicsDevice.DepthStencilState = DepthStencilState.Default; Somewhere earlier: graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; graphics.ApplyChanges(); the models are rendered using a Vertex/Index list with device

XNA 4.0 in a window having jagged edges issues…Know of a method for high quality output?

空扰寡人 提交于 2019-12-13 08:08:24
问题 I'm using this example project's XNA 4.0 form control in an application I'm writing: http://creators.xna.com/en-US/sample/winforms_series1 It's working great and I've done quite a bit with visuals and animation. The main issue I'm scratching my head at is the 3d model and primitive 3D shapes (cylinders with a tessellation of 30) I render have very jagged edges to them as if they are low resolution. I tried to figure out how to enable multisampling, but all of the examples I can find online

How do I get an XNA 4.0 game to run on other machines?

◇◆丶佛笑我妖孽 提交于 2019-12-13 05:27:01
问题 Whenever I try and run a game made in XNA 4.0 on a machine other than ones used for development, it just won't run. I've followed the instructions here to ensure that all the dependencies are present. To be clear I've done the following: Downloaded and installed the Microsoft .NET Framework 4 Client Profile. Downloaded and installed the Microsoft XNA Framework Redistributable 4.0. Made sure I am not using anything contained within GamerServices and Microsoft.Xna.Net.* , my references are as

Using Generic Functions for collision detection in C# / XNA

别等时光非礼了梦想. 提交于 2019-12-13 02:29:16
问题 I am making a physics engine in c# / XNA, I have three basic objects... Sphere Cube Plane that are all derived from GameObject I store all my objects in a list of GameObjects and I would like to loop through this list and be able to call a CheckCollision function that will go to the correct function for each pair of objects eg go is a Sphere, go2 is a Sphere if(CheckCollision(go, go2)) { //do stuff } bool CheckCollision(Sphere one, Sphere two) { //Check Sphere to Sphere } bool CheckCollision