Tag Info

New answers tagged

4

You can reduce the instruction count by using vector operations: e.g. instead of edr = bool4((w1.x < w2.x) && ir_lv1.x, (w1.y < w2.y) && ir_lv1.y, (w1.z < w2.z) && ir_lv1.z, (w1.w < w2.w) && ir_lv1.w); you can write edr = (w1 < w2) && ir_lv1; Operators in HLSL ...


4

I got this working. It does not use the hqx filter, it uses the xBR filter (which I prefer). For me, this is not a problem. If you require the hqx filter then you'll want to convert the .cg files into their appropriate XNA equivalent. For completeness and searching reasons, I will be editing the question to be more concise and then posting all the relevant ...


1

You need to either interpolate or extrapolate the collision. Basically this means instead of just checking the collision of the object where it is NOW, check the collision of the object with where it is and where it WILL BE or WAS, then check x number of times in between those positions. Vector2 pos = ball.position; Vector2 prevPos = ball.previousPosition; ...


0

In your loop, you are using this overload: http://msdn.microsoft.com/en-us/library/ff433987.aspx, which instead of specifying a scale, specifies destination and source rectangles. It's hard to tell from the names you chose if you provided the correct rectangles, but you specified g_BotInvadersRect[r, c] as the destination (screen bounds) and ...


1

Set Game.Content.RootDirectory to the path you want and then just specify the file name portion. But keep in mind that you still have to include them in the Content project. If you don't want to/can't do that, then forgo the ContentPipeline altogether.


2

Dynamically importing and processing content at runtime is explained in the sample WinForms Series 2: Content Loading. This is the preferred method. You can also build an XNA Content Project file using MSBuild. this blog post explains how. You can create a temporary project file, so you don't need to modify or rebuild files in your Solution. Additional ...


0

In Visual Studio... Right mouse click on the Content Project Select 'Add' then 'Existing Item...' Navigate to the folder containing your content, change the filetype from the drop down box if needed, select your content file, then click on 'Add'. Use your content.


0

I figured it out. Hopefully this can help someone else. private short[] indexData = new short[] { 0, 1, 2, 2, 3, 0 }; private VertexPositionTexture[] CreateTriangles(Vector2 location, int width, int height) { /* this is what the index data tells us * * 2 ________________ 3 * |\ ...


0

In the code here : new VertexPositionTexture(new Vector3(1f, -1f, 0f), new Vector2(1, 1)), new VertexPositionTexture(new Vector3(-1f, -1f, 0), new Vector2(0, 1)), new VertexPositionTexture(new Vector3(-1f, 1f, 0), new Vector2(0, 0)), ...


0

Keep in mind that in XNA (and all other 3D libraries), 2D is 3D! In XNA, sprites are just 3D planes drawn to the screen. Any shader you use in 3D will work just as well with the spritebatch. Spritebatch.Begin() has a parameter for the shader to pass in. If I'm following you, you want to use the depth image to blend between two images. Here's what I would ...


0

I wouldn't even try to use pixel perfect collisions for this. Given the fact that you've got a limited and fixed amount of possible tiles as well as pretty simple rules ("allow player to leave the tile in some direction or not"), I'd just work with a bitmask/property for your tiles. For example, you could create an enum with the possible directions: enum ...


1

You need a Source Rectangle and Destination Rectangle. The Source Rectangle will pull a rectangle defined by you out of the sprite sheet, then draw it at the specified position. PsuedoCode int width = txtHero.Width / Columns; int height = txtHero.Height / Rows; int row = (int)((float)currentFrame / (float)Columns); int ...


1

You seem to be confused with some OO aspects here. When you have a class such as: class Meteor { } You are describing a template for every meteor you are going to create. This will describe what a SINGLE meteor should contain. So, following that, what attributes should EACH meteor have? class Meteor { Texture2D texture; Rectangle bounds; int ...


0

Welcome to the GameDev StackExchange. For starters, as per the comments on your question, move the List of meteors out of the Meteor class, and into your base game class (by default Game1.cs) along with the createMeteor() function/ Then in Game1, modify the Update method to loop over the list of Meteors, and call update on them. Do the same for Game1.Draw ...


1

There is a simple approximation you could apply here. Lets say the movement pace you want is 1.0 units per frame. You start with t = 0 and a stepSize = 1.0 Lets say the function getBezierPoint(t) returns a position on the bezier, now you do a binary search like approximation: desiredStepSize = 1.0; // How much we move each frame / second ... some other ...


0

As the error states, You may be pointing to the wrong directory, file, or type of file. Make sure to Add the song to game content by Right-Clicking on your designated Content Folder >> Existing File >> Select the File. Make sure that your audio is supported by the Content Pipeline : http://rbwhitaker.wikidot.com/managing-content. Verify that the File ...


0

In addition to using XNA Refresh, as mentioned in the other answer, you could also use a script to install XNA for you. It will automatically build part of VS 2010 temporarily, as I can only assume Refresh is doing, then delete it after it has installed XNA. This script (both 64 and 32 bit versions) can be found here, and only requires Windows Powershell, ...



Top 50 recent answers are included