Sign in
|
Join
|
Help
Pavel's Blog
Pavel is a software guy that is interested in almost everything
software related... way too much for too little time
Home
Contact
About
RSS
Atom
Comments RSS
Go
Tags
.NET
.NET 4
.NET 4.0
.NET 4.5
.NET2
64 bit
AI
AJAX
Algorithms
ASP.NET
Audio
Azure
BigInteger
BUILD
C#
C# 3.0
C# 4.0
C# 5.0
C++
C++/CX
C++0X
C++11
CLR
CLR Explorer
COM
COM Apartments
Console
courses
D&D
Debugging
DEV
Developer Academy 3
Device Drivers
DirectCompute
DirectX
Fun
Games
Graphics
Intel
Intellisense
Internals
Interop
ITPRO
LINQ
LINQ to XML
Mathematics
Media Foundation
Memory Map Viewer
Metro
MFC
Multithreading
Native API
Native Development
NLP
Numerics
OFFTOPIC
OpenDay
PARSING
PDC2008
ReSharper
Robotics
Roslyn
Silverlight
Silverlight 2
Task Parallel Library
TECH
teched
teched_il
TechEd2010
TechedIsrael2008
thoughts
Threading
Tips
Tutorial
video
Vista
Visual Basic
Visual C++
Visual Studio
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2012
VS 2010
WebTech
Win32
WinDbg
Windows 8
Windows Devices User Group
Windows Phone
Windows Phone 8
Windows Phone User Group
Windows Platfrom User Group
Windows Runtime
Windows7
WPF
XAML
XNA
מכללת הי-טק
Archives
May 2013 (2)
April 2013 (2)
March 2013 (3)
February 2013 (2)
January 2013 (2)
December 2012 (3)
November 2012 (3)
October 2012 (5)
September 2012 (6)
August 2012 (4)
July 2012 (2)
June 2012 (4)
May 2012 (5)
April 2012 (4)
March 2012 (7)
February 2012 (7)
January 2012 (6)
December 2011 (6)
November 2011 (5)
October 2011 (5)
September 2011 (5)
August 2011 (5)
July 2011 (3)
June 2011 (3)
May 2011 (3)
April 2011 (3)
March 2011 (8)
February 2011 (4)
January 2011 (5)
December 2010 (5)
November 2010 (13)
October 2010 (4)
September 2010 (5)
August 2010 (7)
July 2010 (1)
June 2010 (3)
May 2010 (4)
April 2010 (1)
March 2010 (2)
February 2010 (2)
January 2010 (3)
December 2009 (1)
November 2009 (4)
October 2009 (5)
September 2009 (3)
August 2009 (1)
July 2009 (4)
June 2009 (3)
May 2009 (2)
April 2009 (3)
March 2009 (2)
February 2009 (5)
January 2009 (3)
December 2008 (2)
November 2008 (4)
October 2008 (7)
September 2008 (6)
August 2008 (5)
July 2008 (6)
June 2008 (3)
May 2008 (5)
April 2008 (2)
March 2008 (9)
February 2008 (4)
January 2008 (9)
December 2007 (6)
Navigation
Home
All Posts
RSS
Popular Tags
Browse by Tags
All Tags
»
Graphics
»
.NET
(
RSS
)
.NET 4
Algorithms
C#
C# 5.0
DEV
DirectX
Fun
Games
Interop
MFC
Numerics
Shaders
Silverlight
Tutorial
VS 2010
Windows Phone
WPF
XAML
XNA
Towers of Hanoi–WPF Style (Part 2)
13 February 12 10:45 PM
|
pavely
| with
no comments
In the first part , we saw how to recursively solve the Towers of Hanoi problem in C#. In this post I want to show a graphic view of the solution. This is a starting position with 7 discs: This is how it looks when the problem is solved: In between, the discs move with animation from pole to pole, as the solution dictates. Options include speeding up the process (with the slider, very useful), pausing the animation and resetting to the initial state. Here’s something in the middle: The Poles The...
WPF Tip: Displaying Images in different Pixel formats
30 January 12 12:25 AM
|
pavely
|
3 comment(s)
If we want to show an image in WPF, we typically use an Image element and connect its Source property to some image resource within our project: < Image Source ="Penguins.jpg" /> The Source property is not a string, it’s an ImageSource – an abstract type with several concrete implementations that provide a “real” image source. The above markup works thanks to the help of a type converter, that makes the source a BitmapImage – one of the simplest sources, that presents the image as...
Using the Async CTP With Windows Phone
07 January 12 12:05 PM
|
pavely
| with
no comments
The Async CTP that exposes C# 5.0 features to be used with asynchronous programming is not just for the full .NET Framework. There are versions for Silverlight (4 and 5) and even Windows Phone (which can be viewed as Silverlight 4, but has a separate supporting assembly). To demonstrate, I’ve adapted my sample of the Mandelbrot set to Windows Phone, while taking advantage of the async features to keep the UI responsive. After creating the initial Silverlight for Windows Phone project, I’ve added...
WPF For WinForms (and MFC) Developers, Part 1
11 January 11 04:00 PM
|
pavely
|
3 comment(s)
WPF has been around for more than 4 years now (since the release of Windows Vista), but only in the last couple of years there is increased move from Windows Forms to WPF. However, the transition is anything but easy. This is not just because WPF is relatively new, or because people are people, and as such don’t like change for the sake of change. I mean, WinForms is ok, isn’t it? MFC may be old, but it works, doesn’t it? The term User Interface (UI) has served us for years. In recent years, this...
XNA 2D Game Tutorial (Part 11)
17 November 10 07:25 PM
|
pavely
|
6 comment(s)
Previous posts in this series: Part 1 : Getting started Part 2 : Drawing something Part 3 : Input handling Part 4 : Game Components Part 5 : Animation and Sprites Part 6 : Handling Projectiles Part 7 : Sound Effects Part 8 : Setting Up Data Part 9 : Creating Aliens Part 10 : Collision Detection In the previous part we did some collision detection between the player’s missiles and the aliens. If hit, the alien disappeared gradually (as opposed to a big explosion). Let’s add some more collision detection...
XNA 2D Game Tutorial (Part 9)
14 November 10 10:20 PM
|
pavely
|
3 comment(s)
Previous posts in this series: Part 1 : Getting started Part 2 : Drawing something Part 3 : Input handling Part 4 : Game Components Part 5 : Animation and Sprites Part 6 : Handling Projectiles Part 7 : Sound Effects Part 8 : Setting Up Data In the previous post we prepared the data for the aliens and for the game levels. In this post, we’ll put that data to action. The first thing we’ll do is create a custom Alien class, that extends the Sprite class and adds some specific alien attributes. This...
XNA 2D Game Tutorial (Part 6)
09 November 10 01:20 PM
|
pavely
|
10 comment(s)
Previous parts in this series: Part 1 : Getting started Part 2 : Drawing something Part 3 : Input handling Part 4 : Game Components Part 5 : Animation and Sprites In the previous part, we added animation capabilities to a general Sprite class. Our next step is to add firing capabilities to the player. The first thing we’ll do is move the player logic to its own component. This would make it flexible (allowing us to disable it in a title screen, for example) and easier to maintain. Add a new Game...
XNA 2D Game Tutorial (Part 5)
07 November 10 10:17 PM
|
pavely
|
15 comment(s)
Previous parts in this series: Part 1 (Getting Started), Part 2 (Showing Something), Part 3 (Input Handling), Part 4 (Game Components). What do we have at the moment? A ship we can control with keyboard and stars flying by, implemented as a DrawableGameComponent for flexibility and modularity. Although the ship seems to move, it’s still too static. Its engines are not changing. What we want is some animation. Perhaps toggling between two images such that the engine would seem to fluctuate? Animation...
XNA 2D Game Tutorial (Part 4)
06 November 10 12:06 AM
|
pavely
|
10 comment(s)
Previous posts in this series: Part 1 , Part 2 , Part 3 . Our sprite ship is moving with the help of the arrow keys. But it doesn’t seem to be travelling through space. Perhaps we should add some starts going by, as the ship travels forward at incredible speeds… We could continue with the same basic idea we use with the player’s ship: Add appropriate variables, update stars position in the Update method and draw them all in the Draw method. This will cause some bloating of Update and Draw , not to...
XNA 2D Game Tutorial (Part 2)
02 November 10 12:18 PM
|
pavely
|
14 comment(s)
In the first part we just created a black window. It’s time to see something more interesting. The first thing we’ll do is change the window size. The window size is important for practical purposes – all our sprites (soon to be drawn) need to be with a good relative size, the space for movement must be sufficient, etc. The other thing is full screen mode. In a typical game, immersion is the keyword. To immerse the player inside the game, she should not see the taskbar, messenger popping up, etc...
XNA 2D Game Tutorial (Part 1)
01 November 10 10:30 AM
|
pavely
|
15 comment(s)
I like creating games. In fact, that’s what drew me into the computer world back in 1983. It’s amazingly satisfying seeing one of your creations looking like it’s alive, making decisions and reacting to the player’s actions. Back then I used to create games for the legendary Commodore 64 , with it’s 64KB of RAM (of which about 39K was free for the programmer), 1MHz 6510 CPU (yes, 1 mega-hertz!), its video chip (VIC) that supported 8 hardware sprites (more on that in a bit) and its sound chip (SID...
Frame Based Animations in Silverlight
11 August 10 12:30 PM
|
pavely
|
1 comment(s)
One way to do animations in Silverlight is to make gradual changes to dependency properties. Although this is powerful and convenient, it lacks in control. For example, developing a game with Silverlight may require complex movements of “bad guys” and other background elements that are not well suited for the property-based animation. The alternative is frame-based animation. That is, every frame some change is applied to an element (such as the attached Canvas.Left and Canvas.Top properties, effectively...