075_《Delphi图形和游戏编程突破》

《Delphi图形和游戏编程突破》

Delphi 教程 系列书籍 (075) Delphi图形和游戏编程突破》 网友(邦)整理 EMail: shuaihj@163.com

下载地址:

Pdf

  • by John Ayres
  • Wordware Publishing, Inc.
  • ISBN: 1556226373 Pub Date: 12/01/99

内容简介

In the beginning, there was darkness. In this Age of Innocence, the unwashed masses practiced the art of

entertainment with small pieces of paper bearing symbolic images of kings, queens, and jesters. Sometimes,

they used minute pieces of metal and plastic, shaped like various real-world objects, moving them about on

large, colored cardboard sheets in accordance with the runes inscribed upon small white cubes. To the casual

observer, all was content, but in the minds of the newest generation born of this age, there was a yearning for

more. Unbeknownst to the world, this yearning grew, and soon these young pioneers began working in the

dark recesses of colleges and universities to bring about a change that would alter the course of history in

ways no learned scholar could have ever imagined. Brandishing vacuum tube sabers and using arcane words

of power such as RAM, ROM, Bit, and Byte, these acolytes of technology brought forth a new creation

known as the Computer. But, their new creation was naive, and lacked intelligence or sophistication; to

control it, they had to use a mystical, magical language known as Code. Thus, the Art was born, and a new era

had begun.

The First Age was marked by the genesis of immense, hulking beasts that required enormous resources to

sustain life. These new life forms were rare, but typically stood several stories tall and required incredible life

support systems to maintain an agreeable environment. These giants were moody and possessed little

intelligence, but through great effort, they could be trained to perform incredible feats, for their day. The

digital landscape was dotted with few of these behemoths, and their trainers were monk-like in their

dedication. Unable to break free of their confines due to the immense size of their charges, these monks were

forced to toil maddeningly long hours. Their torturous task of preparing the vegetarian meal of holy leaves

consumed by these monsters had them working late into the night, and the Art required to create these holy

leaves was arcane indeed.

These monks practiced the great Art in the same dark recesses from whence it was conceived, and the Art

grew. The once young pioneers had become pedantic, wizened old masters. These old wizards were still

rebellious and, yearning for a new form of entertainment, they used the Art in ways that the Powers That Be

felt were unproductive. Away from the watchful eyes of their overseers, they shaped the Art in ways that

previously existed only in their dreams.

In the dark hours of the morning, these masters used the Art to coax the new creations into providing their

long-sought-after entertainment, and they played games such as Tic-Tac-Toe and Pong. Several of these

wizards used the Art to create much more sophisticated forms of entertainment, and played games such as

Checkers and Chess with their silicon automatons. In the wake of the First Age, walking in the shadow of the

evolving Art, a new form of the Art began to grow.

Like dinosaurs, the reign of these behemoths was relatively short-lived. A new catalyst known as the

Corporation had used the knowledge learned in the First Age to effect an evolutionary step known as the

Home PC. Thus, the Second Age began.

In the Second Age, the pantheon of overlord gods began to form, controlling the evolution of this new

creation from on high. Deities known as Gates and Jobs worked their mystical creation power behind the

curtains of reality, but their new creations were protozoan in nature. A step back from their massive

predecessors, these new single-cell machines were much less sophisticated and powerful, and teetered on the

edge of extinction almost as soon as they had appeared. However, these new creatures had become visible to

the unwashed masses, and began to elicit their attention. At first, few of the Untrained could afford to adopt

one as a pet, but their popularity grew, and soon many of these creations made their homes on desktops in

homes and businesses. The Art, still arcane in nature, had begun to emerge from its dark recesses, and several

of the Untrained began to delve into its mystical powers.

The Net, the once-dark netherworld populated solely by the wizards and masters of the Art, has now become a

tourist attraction, replete with amusement parks, rest stops, and gift shops. Rumors of new CPUs with speeds

in excess of 1,000 MHz are being whispered in the dark corners of cyber cafÈs and coffee shops. Thus, we

stand at the dawn of yet another New Age. As the sun breaks over the distant horizon, its golden, shimmering

rays cascading over the silicon juggernaut that stands before us, the prospects of the future are at once both

exciting and frightening.

Thus, our journey begins.

目录

CHAPTER 1—The Lure of Game Programming

The Dark Side of the Game Programming Industry

Difficult Learning Curve

Long Hours

Corporate Instability

The Light Side of the Game Programming Industry

Fun and Rewarding

Fame and Fortune

The People

Game Programming, In Delphi?

Delphi as a Games Development Platform

Opportunities

Untapped Markets

Types of Games

Real-Time Strategy

Turn-Based Strategy

First-Person Shooters

Adventure Games

Action Games

Puzzle Games

Sports Games

Board and Card Games

Simulations

Windows, Delphi, and Games

Summary

CHAPTER 2—The Anatomy of a Game

Game Dissection: The Vital Organs

Graphics

Sound

User Input

Real-Time Event-Driven Programming

Basic Game Architecture

Initialization

Introduction

Game Startup

The Game Loop

Game Ending

Shutdown and Exit

The Game Loop

Retrieve User Input

Perform Antagonist AI and Other Game Logic

Update Sprite Positions

Check for Collisions

Start Sound Effects

Start Music

Render the Next Frame

Check for Game End

Speed Delay

Game States

The Demo State

The Playing State

The Intermission State

The Paused State

The Game Over State

Case Study

Summary

CHAPTER 3—Basic Graphics Programming

The Graphical Device Interface

Graphical Elements

Pixels

Lines

Polygons

Bitmaps

Graphical Element Classifications

Video Mode Resolutions and Color Depth

Resolution

Color Depth

Video Board Memory

The Components of a Color

Palettized Modes

Non-palettized Modes

Graphics Output Techniques

The Device Context

Painting on the Canvas

Bitmap Essentials

Bitmap Types: DDB and DIB

The TBitmap Object

Raster Operations

Simulating Transparency

Palettes

Logical vs. System Palettes

Using a Palette

Further Adventures in Windows Programming

Summary

CHAPTER 4—An Introduction to DirectX

What is DirectX?

The Promise of DirectX

Benefits and Drawbacks of DirectX Programming

The DirectX Architecture

DirectX Components

DirectX and Delphi

The DirectX SDK

Project JEDI

Other Components and Headers

A DirectDraw Tutorial

Features

Functional Overview

COM Fundamentals

Surfaces

Page Flipping

Resolution, Color Depth, and Video Memory

Windowed Versus Full-Screen

Initializing DirectDraw

Rendering with GDI

Flipping the Surfaces

Displaying Bitmaps

Surface Memory Location

Loading and Displaying the Bitmap

Blitting Surfaces

Lost Surfaces

Retrieving DirectDraw Capabilities

The DirectX Baseline Application

DirectX Result Codes

Retrieving the DirectX Version

Summary

CHAPTER 5—Palettes

What is a Palette?

The IDirectDrawPalette Object

Creating the Palette Object

Defining Palette Colors

Using the Palette Object

Disconnecting Palettes

Palettes and GDI Functions

Palette Animation

Animating the Palette

Screen Transitions

Summary

CHAPTER 6—Sprite Techniques

The Illusion of Animation

Constructing the Animation Frames

Producing the Animation

The Illusion of Motion

Sprite Attributes

The Animation Cycle

Transparency Issues

Color Keying

Pixel Checking

Collision Detection

Bounding Boxes

Pixel Overlap Comparison

Animation Issues

Timing

Z-Order

Summary

CHAPTER 7—Input Techniques

Human/Computer Interaction

Input Devices

Input Considerations

DirectInput

Features

Functional Overview

Initializing DirectInput

Retrieving Input Data

Keyboard Input

Mouse Input

Game Controller Input

Summary

CHAPTER 8—Force Feedback

Features

Functional Overview

Basic Concepts

Kinetic Force

Condition

Magnitude

Coefficient

Duration

Sample Period

Gain

Axes

Direction

Envelope

Force Feedback Effects

Base Effect Structure

Creating Effects

Create and Acquire the DirectInput Device

Query for Force Feedback Support

Initialize a TDIEffect Structure and the Type-Specific Parameters Structure

Create the Effect Object

Download the Effect

Start the Effect

Stop the Effect

Case Study

Additional Effect Considerations

Retrieving Effect Status

Retrieving the Force Feedback System State

Sending Commands to the Force Feedback System

Modifying an Effect at Run Time

Envelopes

Summary

CHAPTER 9—Sound and Music

Sound Effects

Simplistic Sound Effects

DirectSound

Music

MCISendCommand

MIDI

CD Audio

Summary

CHAPTER 10—Optimization Techniques

Optimization Theory

Timing Code

Examining the Algorithm

Effective Optimization

Delphi-Specific Optimization Techniques

Automatic Compiler Optimizations

Additional Compiler Optimizations

Other Delphi-Specific Optimization Techniques

General Optimization Techniques

Loop Unrolling

Lookup Tables

Binary Bit Shifting

Additional Optimization Considerations

Summary

CHAPTER 11—Special Effects

Bitmap Manipulation

Bitmap Transformations

Scaling

Rotation

Lighting Tricks

Transition Effects

Simple Texture Mapping

Dynamic Images

Star Fields

Fire

Summary

CHAPTER 12—Artificial Intelligence Techniques

Movement

Random Movement

Aggression/Evasion

Patterned Movement

Finite State Machines

Probability Machines

Path Finding

Algorithms

Basic Implementation

Back Stepping

Case Study

Enhancements

Summary

CHAPTER 13—Putting It All Together

Delphi Blocks

General Game Architecture

Player Advancement

Game States

User Input

Sound and Music

Graphics

Enhancements

The Case Study Code

Summary

Appendix A

Glossary

Bibliography

Index

时间: 2024-09-27 08:41:46

075_《Delphi图形和游戏编程突破》的相关文章

027_《Delphi Direct X 图形与游戏程序设计》

<Delphi Direct X 图形与游戏程序设计> Delphi 教程 系列书籍 (027) <Delphi Direct X 图形与游戏程序设计> 网友(邦)整理 EMail: shuaihj@163.com 下载地址: Pdf 书名:Delphi/Direct X图形游戏程序设计 作者:(美)艾尔斯著 ISBN号:7-81065-666-X 价格:CNY9.00 出版地:成都 出版社:电子科技大学出版社 出版时间:2001 内容简介 本书的主要目的是教会读者在Delphi环

《HTML5游戏编程核心技术与实战》一2.2 图形API

2.2 图形API HTML5游戏编程核心技术与实战 创建canvas和获取了canvas的环境上下文之后,就可以开始进行绘图了.绘图的方式有两类:一类是进行图形操作,另一类是图像操作.本小节主要涉及图形相关的API,要使用canvas的API进行绘图,通常需要进行下列步骤. (1)获取canvas元素.通过document.getElementById()取得元素. (2)获取canvas元素的环境上下文.通过canvas.getContext ("2d")获取2D图像上下文. (3

Java游戏编程初步

编程 现在流行的游戏似乎都是用C或C++来开发的.在java平台上几乎没有很大型及可玩的流行游戏.由于java是个新生语言,他的许多特性还有待大家的发掘,但是我们不能否认Java在游戏编程方面的强大性.本文将带领大家一步一步学习编写Java游戏.最终打造属于自己的Java游戏. 在开始之前我们得确认你已经安装了Java JDK,并已经安装了浏览器软件如IE.本章是以Internet为开发对象,一步一步教大家认识Java的Thread.Applets-.以及游戏编程要注意的一些方方面面并在每一小部

DirectDraw 与 DirectInput 的游戏编程体验

我想关于这个主题的文章,不算少,但也不算太多.但大多是分别介绍 DirectDraw 与 DirectInput,而并没有将其结合起来,也许你会问:"分开与合并起来并没有本质区别啊!".其实的确没有本质区别,但那样使那些最初对游戏编程报有极大热情的爱好者感到非常失望,因为这其中的一个并不能完全满足他们的要求,并且使其感到巨大的阻力,从而失去信心.所以本文将 DirectDraw 与 DirectInput结合起来去讲一个主题就是"游戏编程",请注意是"游戏

《HTML5 2D游戏编程核心技术》——导读

目 录第1章 概述 1.1 Snail Bait游戏1.2 HTML5游戏开发最佳实践 1.2.1 窗口失去焦点时暂停游戏1.2.2 窗口重获焦点时实现倒计时功能1.2.3 使用CSS实现UI特效1.2.4 对游戏运行缓慢的状态做出检测和处理1.2.5 添加社交功能 1.2.6 将所有游戏图像放在单独的sprite表单中1.2.7 在服务器中存储高分榜和实时游戏数据1.3 特别功能 1.4 Snail Bait游戏中的HTML和CSS1.5 开始Snail Bait游戏编程 1.6 本书中使用的

《HTML5 2D游戏编程核心技术》——第1章,第1.1节Snail Bait游戏

本节书摘来自华章出版社<HTML5 2D游戏编程核心技术>一书中的第1章,第1.1节,作者[美] 戴维·吉尔里,更多章节内容可以访问"华章计算机"公众号查看. 第1章 概 述 令人激动的是,开发人员可以使用软件开发技术使屏幕上出现任何想象的场景.与其他领域受一些物理条件的束缚不同,开发人员长期以来一直使用图形化API和UI工具包来实现富有创造性且引人注目的应用程序.可以说,最有创意的软件开发就是游戏编程.比起让游戏愿景变成现实,优秀的创意还可使我们通过少许努力便获得更多的回

《Python游戏编程入门》——导读

前 言 本书沿着Python Programming for the Absolute Beginner, Third Edition(Michael Dawson著)的步伐,继续帮助初学者学习Python.如果你是初次接触Python的话,我强烈建议你先阅读那本书.你将会通过Dawson给出的易于掌握的示例,快速学会Python语言,这个过程方向清晰.步骤简洁,而且能够掌握重要的概念.Dawson的书会帮助你起步,因此,本书现在是将你的Python提升到更高一点的水平.我们将学习很不错的Pyg

directx9.0-请问DirectX角色扮演游戏编程 怎么编译?

问题描述 请问DirectX角色扮演游戏编程 怎么编译? 请问DirectX角色扮演游戏编程 怎么编译? 我用VC++6.0打开怎么点击是不能通过? 解决方案 http://download.csdn.net/detail/huzhouhzy/4941000 解决方案二: Delphi+DirectX游戏编程

《C++游戏编程入门(第4版)》——2.11 理解游戏主循环

2.11 理解游戏主循环 C++游戏编程入门(第4版) 游戏主循环是游戏中事件流的一般表示方式.事件的核心部分要重复执行,因此称之为循环.尽管不同游戏的主循环的实现不尽相同,但是几乎所有不同种类的游戏的基本结构是一样的.无论是简单的太空射击游戏,还是复杂的角色扮演游戏(Role-Playing Game, RPG),游戏通常由游戏主循环中相同的重复部分组成.游戏主循环如图2.13所示. 图2.13 游戏主循环描述了几乎适用于任何游戏的基本事件流 下面解释游戏主循环的各个部分: 初始化设置.这部分