So I'm making a map editor with C# and XNA. I have currently got it setup so there is a windows for with a picture box, which the game is being displayed through. The problem is this, I want (0,0) to be the upper left corner of the picture box, not the game window. At the moment im trying to return the cursor position but its relative to somewhere in the upper-middle portion of the window...the X-coordinates will go negative if the cursor is in the left third of the screen, and the Y-coordinetes will go negative if the cursor …

Member Avatar
Member Avatar
+0 forum 1

Hello All, I am just a newbie trying to explore areas into game developement using .Net (may be XNA studio) though I am not familier with the same. Could you please suggest some tutorials, ebooks for this so that I can start as a beginner and then later on, may be I can proceed to an advanced level of expertise or any other advice that what tool I really need to use for this ? Thanks to all in advance :)

Member Avatar
Member Avatar
+0 forum 3

So I actually posted this in the C# section, but despite peoples best efforts, all all the help there, the problem is still not solved. Background: Im making a game in xna/c# (Who isnt these days). For collision detection, I though I would use rectangles and lists. My thought process was: 1. Load collision map file 2. Parse file, where there is a 1, create a rectangle and add to list 3. In the player class, iterate through the list of rectangles (I called the list 'badTiles') 4. If the player intersects one of the rectangles, prevent them from moving, …

Member Avatar
Member Avatar
+0 forum 3

Hello everyone! My name is Ainis, I am 15 years old. I want to announce that I am starting a new project called "Learning Programming In 2 Years". I got inspired by LethalFrag who just completed his 2 Year Livestream. Main goal of this is to show people how hard and how easy it is to learn programming. To understand what problems you can encourage while you are learning and it should be really fun and interesting to follow my progress and help me to move forward. I am going to be programming with C#, later going to jump to …

Member Avatar
Member Avatar
+0 forum 4

So im making an RPG. For collision detection, I thought I would do it like this: 1. Read text file containing collision data. 2. Iterate through the list using nested for loops. 3. When a value of 1 occurs (denoting an inpassable tile) add a rectangle to list 'badTiles', where the x and y pos of the rectangle is the x and y value from the nested for loop times the tile width and height. 4. Now that all bad tiles are stored in a list of rectangles, we can check for collision. 5. In player class, perform a foreach …

Member Avatar
Member Avatar
+0 forum 9

So im making a simple RPG using c# and xna. For collision, i am using a text file that contains data about whether a tile is passable or not. I iterate through them and create rectangles based on the position of the 'bad' tile in the text file. I then used these rectangles for collision detectiong. Now, I can easily check whether or not the player is collision with these 'bad' tiles by using the 'Intersection()' method of the Rectangle type. What I am struggling with however, is what do I do once the collision is detected. So far, I …

Member Avatar
Member Avatar
+0 forum 1

So im posting this here and not under game development because this is more of a problem solving question, not directly game related. Im making a simple RPG using xna. Im currently working on collision detection, however running into difficulty. I can successfully check for a collision between the player and a 'bad' tile, however I am stumped as to what the engine should do to prevent the player from passing throguth it! Currently, I am getting the players based on an enum 'Direction', which is set whenever one of the 4 arrow keys are pressed. I am then creating …

Member Avatar
Member Avatar
+0 forum 1

So i'm making an rpg game in xna. I can move my player around the screen, however it can also move off the screen. How can I implament a simple camera that will follow the player and prevent them from moving off of the screen? I only need it to follow, not zoom or rotate or anything like that. Any responses will be greatly appreciated!

Member Avatar
Member Avatar
+0 forum 2

So i'm making an rpg game with c# and xna. How can I create a simple camera that follows the player as they move? I only wish for the camera to move as the player reaches the middle of the screen. I dont require it to rotate, zoom in/out like other tutorials I have seen. Any help or suggestions would be greatly appreciated!

Member Avatar
Member Avatar
+1 forum 3

SO im writing a simple map editor using c# and xna. Ive just finished with xml serilization, but when i compile i get the following error: "Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\Chris\AppData\Local\Temp\1vw3tjxm.dll' -- 'Access is denied. ", what does this mean? And how can I solve the problem?

Member Avatar
+0 forum 0

Rewrote this a few times heres the meat and potatoes. Has a few issues such as flashing when moving in different directions quickly. Thinking of trying to clamp a few values to try to stop the diagonal movement,flashing and smoothing out the sprite. Something along these lines might update this later. > A Way to animate a sprite # Materials # * 2d_GameSkeleton * GameStateManagement(not necessary) * a few minutes. * Sprite Sheet Packer Setup your integer values from sprite sheet packer XML something like this int leftx leftx = coordinate value // make a rectangle Rectangle mcsr mcsr.X = …

Member Avatar
Member Avatar
+0 forum 4

I am trying to serialize data in my XNA project. I have a Texture2D background property that I use during runtime, but I also have a 'string property' to hold my Background name. This will allow me to serialize the asset name so I can later use the info to de-serialize later and load into my game. Problem is myTexture.Name property is suppose to hold the Asset Name but when I try to serialize into an XML file, the BackgroundName Element is empty. Here is what the Property code looks like: //This property is Only used for serialization, //myTexture is …

Member Avatar
Member Avatar
+0 forum 1

I've created this code which should look in the Songs folder and add any .mp3 file to a list. However when I test it it keeps saying File not found and pointing to the exact file it cant find with the name of the song while I dont mention this name anywhere in the code so it must see it at some point. Here is my code I hope anyone knows whats wrong: http://puu.sh/WgWW (d/w its a screenshot) Thanks! :D

Member Avatar
+0 forum 0

Hey, so I just created a new Youtube video with some highlights about my new Indie game "Temporal Wars". I have been trying to get this cool game out for over a year now!! But the Xbox indie reviewers are tough! Which is good, but this is like 5 times I have updated this stuff! Has anybody ran into this issue with the XNA website? Anyway... Here is my new video -> http://youtu.be/7Vo0t25p2vg Ben :)

Member Avatar
+0 forum 0

Good morning, So i was finally able to solve all the errors in my game, but now i can't seem to get a Motion Detector to work using Aforge, so far i've got: private void device_NewFrame(object sender, AForge.Video.NewFrameEventArgs eventArgs) { tmpImage = eventArgs.Frame.Clone(Rec, PixelFormat.Format24bppRgb); Bitmap image = (Bitmap)tmpImage.Clone(); //BitmapData bitmapData = image.LockBits( new System.Drawing.Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadWrite, image.PixelFormat); //BlobCounter blobCounter = new BlobCounter(); //blobCounter.FilterBlobs = true; //blobCounter.MinHeight = 5; //blobCounter.MinWidth = 5; ////blobCounter.ProcessImage(bitmapData); ////Blob[] blobs = blobCounter.GetObjectsInformation(); //image.UnlockBits(bitmapData); //Grayscale filter = new Grayscale(0.2125, 0.7154, 0.0721); Threshold filter2 = new Threshold(200); Invert invert = new Invert(); Bitmap grayImage = Grayscale.CommonAlgorithms.BT709.Apply(image); …

Member Avatar
Member Avatar
+0 forum 1

Good morning, I'm coding a game which ovject is to capture the feed of a webcam, then apply some filters to detect movement, so far i've managed to get the webcam to work but when i apply the filters it says "Bitmap locked" i've managed to solve that error, right after that said something about PixelFormat overlay must be valid, or something like that, anyways i fixed that one also, but now i'm stuck on this error "System out of memory exception", i clearly have enough memory for my game. The error appears on: image = eventArgs.Frame.Clone(Rec, PixelFormat.Format8bppIndexed); But when …

Member Avatar
Member Avatar
+0 forum 9

I am making a c# level editor and it is a bit out of my league but it should be good to learn oop algorithems. I have only just started and have already come across a problem. ** I need to load images as sprites and then create a button with the image on and the button's text being the images name. **The button will then call a diolog box which will contain a load of check boxes about which premade methods the sprite will use. All the information: checkboxes, name, image will later be compiled down to a class …

Member Avatar
Member Avatar
+0 forum 6

I have been using XNA recently and discoverd a major difficulty: when designing levels you have to spen ages pre planning exactly where sprites/objects will go. To solve This problem I had an idea for a game engine/level editor that just imports sprites, creates variables for the sprites and has a wysiwyg 2d level editor, I am hoping the level editor will be similar to the game maker or 001 Engine editor. It will convert this data into code and all other functionality/object behavior will still be done in "normal" XNA code. The area I was confused with is weather …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm developing a XNA Windows Game 4.0, and I keep getting this error: The type or namespace name 'Color' does not exist in the namespace 'Microsoft.Xna.Framework.Graphics' (are you missing an assembly reference?) I can't seem to find the answer for this, can anyone help? Thanks EDIT: Solved it color type is in Microsoft.Xna.Framework namespace

Member Avatar
+0 forum 0

So, as indicated by the title, I have an interesting problem. In my 3d game I have several models -some of which are in world space (they are transformed by the view matrix, these models include asteroids, the home planet, the ship, etc), and some of which are in view space (these models are not transformed by the view matrix, they're a part of the games HUD and include an arrow that will always point towards the home planet). This brings me to my problem; I understand how to make one object in view space point to another in view …

Member Avatar
+0 forum 0

Hi, I'm an amateur programmer developing a 3d asteroid/space based game in xna. In my game I have a ship with a chase camera attached to it. Attached to the camera (and here I mean its position is calculated relative to the camera) is an arrow model that always points towards the home planet in the game. The arrow works well, but if I get far enough away from the planet it starts shaking, most likely because the immense distances between the planet and the arrow are causing inaccuracies in its calculated position. Is there any way to stop this …

Member Avatar
Member Avatar
+0 forum 2

Hello, for my Game I used this tutorial from riemers for automatically scalling graphics relative to the current resolution of the game window: http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Resolution_independency.php If I change from the baseSize to another resolution the Mouse position gets messed up, I have a custom cursor on (int)ms.x, (int)ms.y but when I move it on a different resolution the real mouse is not at the same position as the custom cursor. Does anyone know a solution to this problem? this is how I draw the cursor: public override void Draw(GameTime gameTime) { MouseState ms = Mouse.GetState(); Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, …

Member Avatar
+0 forum 0

o/ Im working on a game in XNA 4.0 and ive started on making an actionbar. What I have is a tileEngine and if I remove a block I want it to appear in my actionbar. but after I got it in the first column of my bar and I pick up another block I want it to appear in the column next to the one thats already filled. So I made 10 rectangles for each column in my actionbar. and I made another Rectangles which states the availeble column. if I fill the first column with something, the availeble …

Member Avatar
+0 forum 0

Well i have a little problem here is the code [CODE] using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace RockRaidersRecreation { /// Manager for Drawing Verts public class WallDrawManager : DrawableGameComponent { Texture2D wallTexture; BasicEffect basicEffect; Vector3 vector1 = new Vector3(0, 0, 0); Vector3 vector2 = new Vector3(0, 0, -10); Vector3 vector3 = new Vector3(10, 0, 0); Vector3 vector4 = new Vector3(10, 0, -10); List<Wall> wallList = new List<Wall>(); public WallDrawManager(Game game) : base(game) { } public override void Initialize() { wallTexture = Game.Content.Load<Texture2D>(@"textures/2d/dirt"); basicEffect = new …

Member Avatar
+0 forum 0

Hello guys i have a problem with my for loop it should create a 100 by 100 field with 10x10 squares each squares are created by 4 vectorpositiontextures. it works fine until the 5th line there i have only 96 squares and then no more other squares. sry it is not commented very well but i hope you can help me. i am using xna 4.0 for a windows game. thx [CODE] using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace RockRaidersRecreation { public class Game1 : Microsoft.Xna.Framework.Game …

Member Avatar
Member Avatar
-1 forum 1

Hello... I've been a VB.NET developer for quite some time, but I decided to start making games. I bought a book called "Begginig C# game development" by Ron Penton... I've read the first half of the book that's about how C# works and stuf, but in the second half we get into making my first game... Now, the problem is: he shows me how to make the game in Direct3d/DirectX but I only have XNA installed... I've heard that Direct3d/DirectX is becoming obsolete so I was wondering if what the book says still applies exactly the same to XNA, if …

Member Avatar
Member Avatar
+0 forum 1

Hi, I want to make a small game,but I need help with Ruminate GUI (XNA 4.0).My question is how to put buttons in a panel that appears when the course goes over its location - let's say on the left of the screen. I have written some code but I faces some troubles when this statement execute [CODE] gui.Draw(); [/CODE] the models in my scene "turn" to the opposite direction,I mean when I use this instruction the models rotate 180 degree. the second question is how to rotate a mesh (or a model) around a line (not an axis). I …

Member Avatar
Member Avatar
+0 forum 1

Hey, I've stumbled upon a small problem with my game. I have 10 wasps that have some AI, just wandering around and whenever a wasp gets close to the queen wasp it starts chasing it. the queen just wanders around aswell. I can also move with my character and if I get close to either the wasps or the queen they will evade me. this all works fine however, I want to perform an action if ALL the wasps are chasing the queen. (I have an enum state for wander/chasing/evading) I made the array wasp in the game class and …

Member Avatar
Member Avatar
+0 forum 1

I'm creating a new functionality for an already existing software, made with VB .Net. This new functionality consists of rendering 3D objects on a specific form, and be able to move/rotate/resize/change,... those objects. For this task i've used XNA. I've created a new XNA Windows project and, in the specific form, i've placed a panel. When the form is instanciated i give the Panel1 handle to the XNA project which i use to create the GraphicsDeviceManager. Everything is working well, except for a window that is shown every time i call the VB .Net form. This windows has the VB …

Member Avatar
+0 forum 0

I need to control a 3D object using wii remote (motion plus inbuilt) in xna gaming environment. I am using C#. Actually I want to do something like in wii cricket or in wii tennis in xna gaming environment using c#. its a pleasure you can suggest me a place where I can got some help, sample codes, sample projects or any kind of help related to this question as soon as possible. Thank for you for your valuable consideration..............!!!!!!!

Member Avatar
+0 forum 0

The End.