|
Post by da on Mar 15, 2012 14:19:10 GMT -5
Ok, Please bare with me, After about a week of working with your pong code and other tutorial/source/starter kits out there I am about to go crazy. haha. It's because five years ago I was "decent" at c++ and c. And last week I picked up C# and have spent about 40 hours with it. Ok, that's my sad story. Here is my problem. I needed to merge two ".cs" files into a single one. I'm not sure if that is a form or not in c#. Anyways, I also had to merge 2 "public partial class"(es) into 1. The result worked mostly. The "other" code works well, and most of your SDK code works fine. No errors at least. The problem is, "loadsprite()" doesn't seem to do anything anymore. But it doesn't error either and I can "track it's x/y" movement and it gives me a spriteCount = 1 (i check in a textbox)... but the dam thing just is invisilible. I've checked all the form "properties" and set them to what you used on your gamewindow. Still, nothing works. No errors, but no graphic either. Got any ideas for me? I have double checked the graphic and loaded different graphics and loaded that graphic using a picturebox, all of that works fine.
|
|
|
Post by Ashley on Mar 15, 2012 19:50:01 GMT -5
Hmmm... that does sound really weird? Im not quite sure what the problem is? Just make sure that all the references to the form object are the same throughout, and you may have done this already but there is a designer code file as well as the main code file so make sure they have been merged correctly without any conflicts etc.. apart from that im realy not quite sure.. the one thing about c# is it can be very fussy sometimes lol..
|
|
|
Post by dragonalumni on Mar 16, 2012 3:04:34 GMT -5
i had to copy some of the initalizecomponent() options directly from the gamecode design, it's quite picky though if you copy the wrong thing it blows up. the stuff required was under // bgl but not all of it. the main thing was kickstarting init() with timers a powerful language + a powerful graphics interface = headache. edit: problem with handmodifying initalizecomponent as it over-writes with autogenerated code, i'm not sure how you got your custom variables into that form, i'll figure it out later, for now i made a seperate initalizeEngine function with the code i needed from sdk.design private void InitializeEngine() { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Load += new System.EventHandler(this.startTimer); this.Paint += new System.Windows.Forms.PaintEventHandler(this.Draw); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyDown); this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.keyUp); this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.mouseClicked); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mouseDown); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mouseMove); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mouseUp); } like i said i'm not sure how to set any of these functions legitimately yet so, this is a hack edit: i found that these functions are set in the properties.events of the main form. ! +1 for newbie
|
|