自 QXGame (WPF GAME ENGINE) 發布以來備受關注,遂萌生寫教程念頭。本系列將帶領大家用純 C# 開發 WPF/Silverlight 遊戲引擎,過程中開源並解釋技巧,複雜算法給出可行思路。轉載請在文章開頭顯著標註來源,支持是持續更新動力。
網路教程多用 Blend 或 XAML 寫死動畫,誤以為 WPF 只是微軟版 Flash。若照那樣開發無法超越 Flash,何苦投入精力?本系列全方位用純 C# 動態建立可視化物件,構建如 QXGame 的引擎,才是真正目標。
開發工具:Visual Studio 2008 SP1
<Window x:Class="WpfApplication1.Window1"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml" Title="WPFGame">
<Canvas x:Name="Carrier" Width="800" Height="600" Background="Silver"
MouseLeftButtonDown="Carrier_MouseLeftButtonDown" />
</Window>