34 Replies - 3359 Views - Last Post: 02 November 2010 - 11:56 PM
#16
Re: My player's sprite wont draw
Posted 21 September 2010 - 04:24 PM
#17
Re: My player's sprite wont draw
Posted 21 September 2010 - 04:27 PM
Kilorn, on 21 September 2010 - 03:24 PM, said:
What's wrong with it? It's on the correct line plus he doesn't have any of the Xbox 360 only stuff in his project.
Also I was using this to compare line by line what he had in both ship.cs and game1.cs and there was nothing out of place, not even a single missing ;.
This post has been edited by ShadowsEdge19: 21 September 2010 - 04:29 PM
#18
Re: My player's sprite wont draw
Posted 21 September 2010 - 04:31 PM
#19
Re: My player's sprite wont draw
Posted 21 September 2010 - 04:33 PM
#20
Re: My player's sprite wont draw
Posted 21 September 2010 - 05:01 PM
edit:
haha all you chaps get rep, rep all around!
i noticed the book adds keyboard = Keyboard.GetState(); to the Game1 update method, but thats impossible because he calls it in the Ship.cs and everytime i put it there i get a syntax error telling me keyboard doesnt exist...
This post has been edited by Dev1462: 21 September 2010 - 05:08 PM
#21
Re: My player's sprite wont draw
Posted 21 September 2010 - 05:16 PM
#22
Re: My player's sprite wont draw
Posted 21 September 2010 - 05:18 PM
#23
Re: My player's sprite wont draw
Posted 21 September 2010 - 05:29 PM
#24
Re: My player's sprite wont draw
Posted 21 September 2010 - 05:36 PM
Kilorn, on 21 September 2010 - 04:29 PM, said:
yeah i just tried that, and i got it to fit in, but i still cant move my character around. My character controls are in the update method for the Ship.cs class. Now im just stuck with that. probably some other stupid little thing
#25
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:11 PM
Dev1462, on 21 September 2010 - 04:36 PM, said:
Kilorn, on 21 September 2010 - 04:29 PM, said:
yeah i just tried that, and i got it to fit in, but i still cant move my character around. My character controls are in the update method for the Ship.cs class. Now im just stuck with that. probably some other stupid little thing
You put KeyboardState keyboard in the declarations of game1 but you have to initialize keyboard = Keyboard.GetState() in game1's Update otherwise it'll find the one state when the game starts (which will be do nothing) and it won't get updated at all.
This post has been edited by ShadowsEdge19: 21 September 2010 - 06:17 PM
#26
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:22 PM
EDIT: Just tested my code and it doesn't matter where it's initialized, it will still work the way it's supposed to.
And also, even if I take the declaration and initialization out of the game1 class all together, it also still works... I'll dig around some more in your code and hopefully find a solution for you in a minute.
NEW EDIT: On line 73 of your Ship.cs class, at least the one that's posted on page 1 that you posted for me, you have KeyboardState keyboard = new KeyboardState(); this should be changed to KeyboardState keyboard = Keyboard.GetState();.
This post has been edited by Kilorn: 21 September 2010 - 06:33 PM
#27
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:29 PM
Kilorn, on 21 September 2010 - 05:22 PM, said:
EDIT: Just tested my code and it doesn't matter where it's initialized, it will still work the way it's supposed to.
And also, even if I take the declaration and initialization out of the game1 class all together, it also still works... I'll dig around some more in your code and hopefully find a solution for you in a minute.
If only I had problems as small as this in my project
#28
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:32 PM
KeyboardState keyboard;
And here it is being initialized in the Update method of Game1. I dont understand why it isnt working
protected override void Update(GameTime gameTime)
{
keyboard = Keyboard.GetState();
if (player == null)
Start();
base.Update(gameTime);
}
#29
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:35 PM
ShadowsEdge19, on 21 September 2010 - 08:29 PM, said:
Kilorn, on 21 September 2010 - 05:22 PM, said:
EDIT: Just tested my code and it doesn't matter where it's initialized, it will still work the way it's supposed to.
And also, even if I take the declaration and initialization out of the game1 class all together, it also still works... I'll dig around some more in your code and hopefully find a solution for you in a minute.
If only I had problems as small as this in my project
I don't want to derail the discussion, but are you still having issues with the logic in your game not allowing the player to actually do anything after cycling through all the AI's?
#30
Re: My player's sprite wont draw
Posted 21 September 2010 - 06:41 PM
edit: ok re-read it, quoting it didnt show the new edit. anyway, in the Ship.cs if i change it from KeyboardState keyboard = new KeyboardState(); to Keyboard.GetState(); i get a syntax error telling me that it is a method but im using it like a state.
This post has been edited by Dev1462: 21 September 2010 - 06:46 PM
|
|

New Topic/Question
Reply






MultiQuote



|