2、开启 DirectX 游戏编程之旅

开启 DirectX 游戏编程之旅

在游戏编程的世界里,创新至关重要。当我们尝试开发游戏时,不应局限于常见的模式,比如制作类似《战地 1942》的模组、《俄罗斯方块》的克隆版或者《打砖块》的新版本。这些虽然是很好的学习经验,但缺乏创新性。我们应该努力想出全新的游戏创意并将其开发出来,即使概念简单,只要是全新的想法,就可能很有趣。

开启 DirectX 之旅

要开始使用 DirectX 进行游戏编程,我们首先要在 Visual Basic 中创建一个新项目并添加对 DirectX 的引用。以下是具体步骤:
1. 安装必要软件 :
- 若未安装 DirectX 软件开发工具包(SDK),需先进行安装。CD - ROM 提供了专门支持 Visual Basic 的 DirectX 版本,即 DirectX 8 for Visual Basic Type Library,使用这个版本即可,无需安装完整的 DirectX SDK。
- 还需安装 Visual Basic 的 Service Pack 6(SP6)或完整的 Visual Studio,可从 http://msdn.microsoft.com/downloads/ 下载最新更新和服务包。
2. 创建新项目 :
- 打开 Visual Basic,若未自动弹出“新建项目”对话框,可通过“文件”菜单选择“新建项目”。
- 选择“标准 EXE”作为项目类型,Visual Basic 会创建一个新项目并添加一个默认的窗体“Form1”。
3. 添加 DirectX 引用 :

相关推荐

1、用 Visual Basic 和 DirectX 开启角色扮演游戏开发之旅

本文介绍了使用 Visual Basic 和 DirectX 开发角色扮演游戏(RPG)的基础知识和核心技术。内容涵盖游戏编程基础、DirectX 的使用、游戏项目概述、开发流程、角色开发与互动、游戏世界构建、绘制与动画技术、用户输入与碰撞检测,以及游戏优化等方面。通过详细的代码示例和步骤说明,帮助初学者逐步实现自己的 RPG 游戏。

ruby5的博客 63

掌握Visual Basic与DirectX编程,开启游戏开发之旅

本章节作为Visual Basic游戏编程的入门指引,介绍了如何使用Visual Basic和DirectX库编写游戏。你将学习创建Visual Basic游戏项目,了解DirectX的组件,并开始编写第一个DirectX程序。此外,章节还提供了对Visual Basic和DirectX的概述,强调了跳出常规思维的重要性,并鼓励读者进行创新,以创造出独特的游戏概念。

weixin_28922227的博客 483

Visual Basic与DirectX结合:游戏开发之旅

本文将探讨如何在Visual Basic中添加DirectX支持,并通过构建一个角色扮演游戏来展示DirectX的应用。文章详细介绍了安装DirectX SDK和Visual Basic SP6的必要性,以及如何在项目中添加DirectX引用,并测试引用是否成功。最后,概述了一个以2D为基础的角色扮演游戏项目,Celtic Crusader,其背景故事涉及古代英格兰和挪威维京人的冲突。

weixin_32251525的博客 491

《DirectX 9.0 3D游戏开发编程基础》Frank Luna 扫描版

3D游戏开发作为一种高级的计算机图形编程,为玩家提供了沉浸式的体验。DirectX 9.0作为微软推出的DirectX系列中的重要一员,在2000年代初为广大游戏开发者所青睐。它提供了一套丰富的APIs,使得开发者可以高效地在Windows平台上创建复杂的3D游戏和应用程序。DirectX 9.0在游戏行业的重要性不仅体现在技术上,更体现在市场定位上。它极大地降低了高性能3D游戏的开发门槛,使得中小规模的游戏工作室也能够参与竞争,推动了游戏行业的发展。

weixin_42583683的博客 1393

MATLAB/Simulink实战:三电平逆变器SVPWM调制从入门到精通(附完整仿真模型)

本文提供了一份详尽的MATLAB/Simulink实战指南,手把手教你从零搭建三电平逆变器的SVPWM调制系统。文章深入剖析了27个空间矢量的分区与分解算法,并完整实现了包含中点电位平衡控制的Simulink仿真模型,旨在帮助电力电子与电机控制领域的学习者和工程师跨越从理论到实践的鸿沟。

sugar的博客 1222

简易背单词系统C/C++

#include<stdio.h> #include<string.h> int F=20,N=100,k=0; int score[100]; int count=0; void hello(); void add(); void preview(); void mdelete(); void etc(); void cte(); void mscore(); void...

青木年华 9157

最新打赏系统打赏源码麒麟最新打赏源码喜盈门打赏知识付费课程教程直播讲解

打赏源码打赏系统

qq_41095398的博客 2063

稚晖君Dummy机械臂CAN总线控制详解:从代码到实战(附常见问题排查)

本文深入解析了稚晖君Dummy机械臂的CAN总线控制技术,从协议设计到代码实现,详细介绍了CAN总线在机械臂控制中的核心价值、通信协议栈设计、运动控制指令实现及常见问题排查方法。通过实战案例和代码示例,帮助开发者快速掌握机械臂CAN总线控制的关键技术。

uuu88的博客 301

手把手教你用ADuC845 DAC调试恒流电路(附实测数据与避坑指南)

本文详细介绍了如何利用ADuC845 DAC调试恒流电路,包括硬件搭建、DAC输出校准、低端死区问题解决方案及系统级调试技巧。通过实测数据和避坑指南,帮助工程师快速解决非线性输出和稳定性问题,提升电路性能。

life6的博客 338

PCB仿真软件:Altium Designer_(15).AltiumDesigner的版本控制与项目管理

在进行PCB设计时,版本控制和项目管理是确保设计质量和团队协作效率的关键。Altium Designer 提供了强大的版本控制和项目管理功能,可以帮助设计团队更好地管理和维护项目。本节将详细介绍如何在Altium Designer中进行版本控制和项目管理,包括如何使用版本控制系统、如何管理项目文件、如何进行团队协作等。

kkchenjj的博客 1210

复旦微FMSH_Procise安装全流程详解:从环境配置到实战避坑指南

通过本文的全流程解析+实战技巧,开发者可快速掌握Procise在复旦微芯片开发中的核心应用。未来随着AKConv轻量级架构(参考往期文章)等创新技术的融入,国产芯片开发生态将更加完善。立即关注本专栏,获取最新多镜像切换指南与Linux SDK实战教程!扩展阅读复旦微在线升级BOOT.BIN全解析H7-TOOL实现复旦微脱机烧录(注:本文实验环境为Windows 10 x64 + FMQL45T-CORE开发板,部分操作可能因版本更新调整)立即行动下载本文配套配置文件:[GitHub链接]加入技术交流群。

QQ_778132974的博客 3259

Python 爬虫实战:在房天下抓取房产信息,分析房价走势

通过本次 Python 爬虫实战,我们成功地从房天下爬取了房产信息,并进行了存储、处理、分析和可视化展示。在这个过程中,我们不仅掌握了爬虫技术的基本应用,还学会了如何对动态加载的数据进行处理和分析。然而,本次爬虫任务也存在一些局限性,例如仅爬取了部分区域的房产数据,且未对房产的图片和视频内容进行分析。在未来的工作中,我们可以进一步优化爬虫程序,爬取更多区域的房产数据,并深入分析房产的多媒体内容、用户行为模式等,为购房者和房地产从业者提供更有价值的数据支持。

u014481728的博客 1386

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 4、信息技术时代的科技发展与社会变革
下一篇: 1、Java编程学习全攻略
ruby5
博客等级 码龄15年 29粉丝 893原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址