-
10
pages
-
English
-
Documents
Description
Events Tutorial 0. What are events for? In everyday life as well as in video games, events happen and we need to respond to them. If a car got off the road in a racing game, it should no longer be able to maintain its speed. It would be nice if we could provide instructions to a user and allow him to dismiss them with a click of his mouse when HE is done reading. At the time that a game begins, certain things must happen. All all these are "events" in Alice; they allow the Alice programmer to respond to something happening in the Alice world. In today's tutorial, we will learn to make our programs respond to mouse clicks and keyboard presses, as well as handing camera control over to the user. 1. Loading the World Download the file that we'll be working with today here. Save it in a directory that you can find again, and then start Alice and open it in Alice. NB: You cannot double-click the file to open it; Windows will not know what to use, and even if you select Alice from a list of programs, the loading will fail. This program will already have some code written to make the characters do certain things. You will be using it, but you don't need to understand how it works, although it's great if you do. I want to note that, in this tutorial, I'll use the word "action" for Alice's responses to events, although Alice and programming languages call them "methods." I think it is more intuitive to think of "taking an action" in response to an ...
-
Publié par
-
Langue
English