DCSIMG
Graphics - Pavel's Blog
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

Browse by Tags

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...
A New Android Game in Town (by my brother)
05 February 12 10:36 PM | pavely | 4 comment(s)
Anyone who has ever written a game knows it’s hard to get it done from start to finish. Sure, I can put on a demo of some game I’ve created in several hours. But creating all the graphics, sound, animation, levels, transitions, scoring, etc, from start to finish is quite a challenge, especially for a single developer. That’s why I’m very proud of my young brother, Yaniv , that has worked hard for the past 10 months (while maintaining a proper day job!) on an awesome fun game called Micro Wars , targeted...
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...
The Future of Silverlight
14 November 11 06:33 PM | pavely | with no comments
There’s been a lot of talk lately about Silverlight. Will Silverlight 5 (to be released this month) be the last major version of Silverlight? I don’t know, but here are my thoughts on the subject. Silverlight will stay in the context of Windows Phone, that’s seems pretty sure, but what about the web at large? Is Silverlight (and its rival, Adobe Flash) doomed? In recent years, there has been gravitation towards standards – that is, world wide standards, not Microsoft’s or anyone else’s for that matter...
Windows Phone: Combining Silverlight & XNA in a Single Page
26 October 11 09:30 PM | pavely | 2 comment(s)
There are two very distinct ways to program on Windows Phone 7.x: Silverlight & XNA. Silverlight is about UI, retained graphics and is event driven. XNA is about immediate mode graphics, based on a timer and polling; Very different models indeed. Each has its strengths and weaknesses. One of the new features in WP7.1 (“mango”) is the ability to combine the two to get the best of both worlds. Here’s a typical scenario where this need may come up: suppose you’re developing an XNA game (2D or 3D...
Porting an XNA game from Windows to Windows Phone (Part 2)
14 August 11 03:40 PM | pavely | 2 comment(s)
In the first part we got our introduction screen up and running, with the starfield scrolling by. However, we couldn’t actually start playing because the game was waiting for a key press… which is nowhere to be found on a Windows Phone device. We simply need a little touch. Adding Touch Support Touch is something the XNA version of Windows and XBOX 360 have no notion of. This is specific for Windows Phone. Touch input information is available as “raw” data (touch points, with positions, etc.) and...
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...
תגים:, , , , ,
Visual Studio 2010 SP1 Beta: What’s new in MFC?
25 December 10 03:23 PM | pavely | with no comments
The recently released Visual Studio 2010 SP1 Beta brings many enhancements and bug fixes found since the product’s launch, most of them in the managed world. However, there are new enhancements to the good(?) old MFC , namely wrapping of some of the Direct2D interfaces. Direct2D is a new layer in the DirectX world, sitting on top of Direct3D, providing high performance and flexible 2D graphics. It was introduced with Windows 7 and Windows 2008 R2, but it’s also possible to install it on Windows Vista...
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...
תגים:, , , , ,
More Posts Next page »