Chủ nhiệm Bộ môn Ngô Hữu Phúc ĐỀ CƯƠng chi tiết bài giảNG



tải về 3.11 Mb.
trang3/21
Chuyển đổi dữ liệu24.11.2017
Kích3.11 Mb.
#34506
1   2   3   4   5   6   7   8   9   ...   21
Bài giảng 3: Game Logic

Tiết thứ: 6-7 Tuần thứ: 2+3

- Mục đích, yêu cầu:

• Nắm được các khái niệm logic game, các luật trong game, các nhân vật hỗ trợ người chơi.

- Hình thức tổ chức dạy học: Lý thuyết, thảo luận, tự học, tự nghiên cứu

- Thời gian: Lý thuyết: 2t; Tự học, tự nghiên cứu: 4t

- Địa điểm: Giảng đường do P2 phân công.

- Nội dung chính:



3.1 Advanced programming logic

Programming languages are like modelling clay; They are extremely pliable and can be fired to become rock hard, or watered down to become soft.

But one must understand the basic logic behind it all before one can make serious games. If one does not use sensible logic, the script will expand too rapidly, becoming difficult to edit and nearly impossible to control.

The more you customize your script to automate calculations for you, the better your games will be. After all, the whole purpose of a computer is to do the work for us. Don't bang your head against a wall to break it down while refusing to pick up the sledgehammer that's right next to you. Breaking walls is exactly what sledgehammers are for!

The list of DO's include:

using variables instead of concrete numbers. condensing and simplifying your scripts.

using Algorithms to reduce the amount of scripting.

using inheritance to distribute numbers and reduce calculations.

writing functions to give yourself total control over the game.

3.1.1 Variables (NOT magic numbers)!

Using magic numbers is the first issue that most new users have; They want to describe things in the only way they know how: Basic math.

What happens then is that the user must keep track of all these numbers, and fill them in by hand. Why keep track of numbers in your head? That's what a computer is for!

Using variables is key in creating anything of any complexity. If you challenge this, and decide to use your brain only, the computer will beat you. Easily.

3.1.2 Condense your scripts

GE contains premade functions for many different actions, and some of them are intented only to help new users bypass learning certain things; not all of these functions are meant to be relied on in the long term.

The collisions in GE, for example, are pixel perfect and very fast, so they are intended for professional game use. KEYUP events, however, are simply there to help new users and are not intended for use in professional games.

3.1.3 Using Algorithms

An Algorithm is a method to solve mathematical problems of any sort, to create structures, and to modify data.

Algorithms will save you exponential resources and time. Here is one example:

A user decided to make a graphical keypad using the Canvas.

3.1.4 Inheritance

Inherited behaviour is a staple for professional games companies; redundant calculations waste resources. Inheritance allows you more precise control over game variables; it also allows you to push algorithms farther up the chain of command, resulting in more variable referencing and less variable calculation.

3.1.5. Using functions

This is not a tutorial on functions, but rather an explanation of why we use them.

If we create a spreadshot, as 2d shmups use, we don't have to create new bullet patterns for every bullet.

Instead, we can create a function to create these; and then any enemy or player can access the same function, simply inputting different variables.

What this means is that we can reduce a draw actor script to only a few functions; we don't have to rewrite functions; instead, we can focus on making our bullet spread patterns better and better!

Functions are an integral part of the final, and most important topic of this page:

- Yêu cầu SV chuẩn bị:

Đọc tài liệu

Chú ý nghe giảng.

Tích cực tham gia phát biểu ý kiến



Bài giảng 4: Cài đặt và xây dựng khung chương trình.

Tiết thứ: 8-10 Tuần thứ: 3+4

- Mục đích, yêu cầu:

• Nắm được cách cài đặt các công cụ lập trình cho game.

•Nắm được cách xây dựng các thành phần chính của một khung chương trình game.

•Có thể xây dựng được 1 chương trình đơn giản.

- Hình thức tổ chức dạy học: Lý thuyết, thảo luận, tự học, tự nghiên cứu

- Thời gian: Lý thuyết: 3t; Tự học, tự nghiên cứu: 6t

- Địa điểm: Giảng đường do P2 phân công.

- Nội dung chính:



    1. Cài đặt Eclipse, ADT, JRE.

4.1.1. Các công cụ cần thiết và link download:


- Java SDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html

- Eclipse IDE: http://www.eclipse.org/downloads/

- Android SDK for Existing IDE: http://dl.google.com/android/installer_r22.0.5-windows.exe

+ Google có hổ trợ sẳn phiên bản Eclipse có tích hợp với Android SDK và ADT Plugin, có thể download bộ này cho phiên bản 32bit từ đây, 64 bit từ đây.

- ADT Plugin for Eclipse: http://dl.google.com/android/ADT-22.0.5.zip



+ Bản này là download về và cài đặt offline.

+ Chú ý là số hiệu của phiên bản ADT và Android SDK phải tương ứng với nhau.

+ Link download cung cấp ở đây là phiên bản mới nhất tới thời điểm hiện tại (08/2013).

4.1.2. Cài đặt:


- Cài đặt JDK (nếu máy chưa cài sẳn).

- Cài đặt Eclipse IDE: Phiên bản Eclipse download được ở đây là tập tin nén .zip. Chúng ta đơn giản chỉ giải nén nó ra thôi.



- Cài đặt Android SDK. Hoàn thành, chạy SDK Manager.exe để tải về phiên bản SDK hổ trợ cho việc phát triển ứng dụng.



+ Lưu ý là thời gian tải có thể khá lâu (khoảng chừng hơn 1h, phụ thuộc vào tốc độ đường truyền).

- Cài đặt ADT Plugin: Chạy Eclipse lên, chọn Help – Install New Software…, hộp thoại Install hiện ra.



Trong hộp thoại Install, chọn nút 
Каталог: files -> FileMonHoc
FileMonHoc -> NGÂn hàng câu hỏi lập trình cơ BẢn nhóm câu hỏI 2 ĐIỂM
FileMonHoc -> CHƯƠng 2 giới thiệu về LÝ thuyết số
FileMonHoc -> CÁc hệ MẬt khoá CÔng khai kháC
FileMonHoc -> BỘ MÔn duyệt chủ nhiệm Bộ môn
FileMonHoc -> Khoa công nghệ thông tin cộng hòa xã HỘi chủ nghĩa việt nam
FileMonHoc -> Chủ nhiệm Bộ môn Ngô Thành Long ĐỀ CƯƠng chi tiết bài giảNG
FileMonHoc -> Chủ nhiệm Bộ môn Phan Nguyên Hải ĐỀ CƯƠng chi tiết bài giảNG
FileMonHoc -> Khoa: CÔng nghệ thông tin cộng hòa xã HỘi chủ nghĩa việt nam
FileMonHoc -> MẬt mã khóA ĐỐi xứng lý thuyết cơ bản của Shannon
FileMonHoc -> Khoa công nghệ thông tin bài giảng LẬp trình cơ BẢn biên soạn

tải về 3.11 Mb.

Chia sẻ với bạn bè của bạn:
1   2   3   4   5   6   7   8   9   ...   21




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương