TAILIEUCHUNG - Game Programming for Teens, Seconnd Edition P2

Compiling the code is a very simple procedure. Just open the file (demo01- ) off the CD in BlitzPlus (or type it into the workspace), save the file (FileSave) onto your computer, and select ProgramRun Program, as shown in Figure | 16 Chapter 1 Getting Started caution Because of margin constraints some of the lines of code may have spread over two lines or more. In a real game all of the code must be on one line or else it won t run. For example if I had written something like the following line ElseIf ImagesOverlap ballimage ball x ball y player2image 740 player2 y This tests to see if the ball has collided with player 2 s image. Typing it into the compiler with the line break would not work. It must be on the same line even though the margins in the book made it appear broken up. Figures and show the KONG title screen and main screen respectively. Figure KONG title screen. Figure KONG main screen. Compiling the Code Compiling the code is a very simple procedure. Just open the file off the CD in BlitzPlus or type it into the workspace save the file File Save onto your computer and select Program Run Program as shown in Figure . Well that isn t what you would call a full game. I did not add any special effects or sounds because they aren t very important at this point. The idea is to get a feel for what code looks like and how it is written. You will notice that the meanings of most of the functions are easy to understand because of the function names. This helps in understanding the program. Let me summarize the main parts of a game. The game consists of The initialization section The main loop The shutdown The First Game KONG 17 Figure Compiling the game. Initialization sets up variables and functions that are used throughout the game. Declaration is part of initialization and is used to set up variables that will be used later in the program. The game loop is what you see on the screen. Each iteration an iteration is each time the program runs through the loop of the loop is one frame of the game. Usually there are at least 30 frames or iterations per second. See Figure for a description of initialization the game loop also known as the main loop .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.