Posted by legendsoftheblackmoon in tips, xna.
Tags: c sharp, c#, carlyle oliver, chm, chm error, chm page cannot be displayed, ebook error
Had a bunch of CHM’s .. C# tuts, and was about to take the plunge, well, more like, brush up some C# stuff,when *poof*, none of them wud open, i just , just the tree navigation on the left was visible, but no luck on the right hand side. Now, frustration, its 2 am, i ain’t in a charitable mood, so, now just about to delete the whoel lot of em, when i said, wait a sec, this aint the right thing, poor files, no one harmed them, why consign them to the erased sectors of my hard disk for time immeorial.. okay, enuf with the dramatics… heres the solution
Your CHM files are stored in the folder with ‘#’ (hash) character in the path
Many C# developers discovered that their documentation and e-books in CHM format cannot be read because they were storing their CHM files in the directories like ‘C:\E-books\C#\’
The hash character signifies an anchor in HTML so the CHM viewer fails to resolve the path properly and to retrieve the content.
Solution: Remove the ‘#’ (hash) character from the directory name. Also avoid using ‘?’, ‘&’, and ‘+’ characters in directory names.
Posted by legendsoftheblackmoon in games, tips, xna.
Tags: carlyle oliver, legends of the black moon, messagebox xna, programming in xna, xna, xna help, xna hints, xna tips
Soo .. after a week of toil .. i have a small game, if u may call it that. Its a simple enough concept actually, the player controls a spaceship ( more like a UFO ), and the objective is to navigate through a meteor shower. The speed of the meteors approaching is controllable, programmatically :p Calling it pirated, because i kinda didnt design it myself, just got a few tut’s together, and played it blind with a load of personal mods.
Made a game class :
Game1.cs – Main class that .. acts as the engine, controlling the sprite drawing, game logic and handling the GameComponent‘s.
Ship.cs – The class that describes the player controlled Ship, its size, sprite location, speed and movement, also, its gotta check for movement of the ship, so that it stays within the Window bounds.
Meteor.cs – The meteor class, similar to ship to CS, exception is that the meteor’s created are automated, fixed stuff, placement, initially is random, with the rocks accelerating towards the bottom.
Game Logic : The sprites are loaded, meteor and ship share the same Texture2D, that is, the meteor and spaceship are in one image, just the particular region is selected by the respective classes.
The game engine checks for collisions’, and creates the GameComponents, namely the meteors, and the player ship. The scoreboard was not properly implemented, and i/ or i got bored. Lolzz..
Download the Game Here ( with Source Code )
Posted by legendsoftheblackmoon in tips.
Tags: carlyle oliver, legends of the black moon, messagebox xna, programming in xna, xna, xna help, xna hints, xna tips
Error Handling – Using a MessageBox
Do this … in
Step 1 : Filename : Program.cs
add this, which will allow you to access the WinAPI
using System.Runtime.InteropServices;
Step 2 : now .. inside the static class Program declaration .. add this .. which allows u to link to the WinAPI dll, and specify the function ..
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern uint MessageBox(IntPtr hWnd, String text, String caption, uint type);
Step 3 : and this allows you to do a try-catch .. and thus add a cool ( read .. helpful) MessageBox
try
{
using (Game1 game = new Game1())
{
game.Run();
}
}
catch (Exception e)
{
MessageBox(new IntPtr(0), e.StackTrace, “My Game Made a BooBoo”, 0);
}