O'Reilly Forums: Savethehuamn - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Savethehuamn enemy moving out of the play area

#1 User is offline   Uncle Ben 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 15-January 14

Posted 15 January 2014 - 01:09 AM

Hi,

I am new to C# and Xaml and I am using Visual studio C# 2010 express edition as the IDE.
Well, I am having a hard time to follow up the book by using 2010 express edition (many features, funtions, and libraries are not there), so I always need to figure out a way to do what the book wants me to do. I guess this is why I have the Enemies running out the play area up to this point. Please have a look at my code, and point me to the right direction. Thanks

PS.
1. I think I have a funny list of "using" statements.
2. In AnimateEnemy, type of propertyToAnimate is PropertyPath)

Attached File(s)

  • Attached File  CS.txt (2.15K)
    Number of downloads: 47
  • Attached File  XAML.txt (2.92K)
    Number of downloads: 30

0

#2 User is offline   Uncle Ben 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 15-January 14

Posted 16 January 2014 - 01:35 AM

Hi,

I met another problem today which is that I can't use any Pointer related event handler such as "PointerPressed". Does this have something to do with my IDE (visual studio C# 2010 express edition) and my PC OS (Window 7)?





0

#3 User is offline   AndrewStellman 

  • Andrew Stellman
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: O'Reilly Author
  • Posts: 803
  • Joined: 08-October 08
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:Author of: "Head First C#", "Beautiful Teams", "Head First PMP", "Applied Software Project Management"

Posted 16 January 2014 - 01:10 PM

I looked through your XAML -- are you trying to adapt the Windows 8 code to WPF? It looks like you are, which would also explain your problems with using statements and trouble finding the PointerPressed event (which doesn't exist in WPF). I'm actually pretty impressed that you made it as far as you did!

You'll have a much easier time of things if you use the WPF PDF -- there's a link to it on the book page (http://headfirstlabs.com/hfcsharp). Give that a shot and let us know if that makes your life easier. Also, you'll only need the PDF for chapter 1 and five pages in chapter 2, then you won't need it again until chapter 10. You should have very little trouble with VS2010.

Andrew



Andrew Stellman
Author, Head First C#
Building Better Software -- http://www.stellman-greene.com
0

#4 User is offline   Uncle Ben 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 15-January 14

Posted 17 January 2014 - 12:55 AM

Hi Andrew,

Very appreciate for your tip. Following the WPF PDF rellay made my day. I got the game working now and can't wait to go further.:)







View PostAndrewStellman, on 16 January 2014 - 01:10 PM, said:

I looked through your XAML -- are you trying to adapt the Windows 8 code to WPF? It looks like you are, which would also explain your problems with using statements and trouble finding the PointerPressed event (which doesn't exist in WPF). I'm actually pretty impressed that you made it as far as you did!

You'll have a much easier time of things if you use the WPF PDF -- there's a link to it on the book page (http://headfirstlabs.com/hfcsharp). Give that a shot and let us know if that makes your life easier. Also, you'll only need the PDF for chapter 1 and five pages in chapter 2, then you won't need it again until chapter 10. You should have very little trouble with VS2010.

Andrew









0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users