Thread Rating:
  • 321 Vote(s) - 2.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page 1: Making a Simple Action Game
06-16-2011, 02:03 PM, (This post was last modified: 06-23-2011, 04:38 PM by ashimo.)
#1
Page 1: Making a Simple Action Game
Try 2: Making a Simple Action Game

We can gather data from a user by using controls, which include buttons, lists, and input fields. And, by using events, we can perform processing according to the user’s actions. In this chapter, we’re going to create a simple game using controls and events.

Please download the Try2.zip file by selecting the following link: Try2.zip.

Unzip the contents to the C:\Curl directory. This is the working directory for all the examples and exercises contained within this tutorial. Note: If C:\Curl has not already been created, you can create it now.

The Basics: Displaying Values that are Input from a Control

Create the 'Try 2-1' Project

1. Close the Try 1 project. From the “File” menu, select “Close Project.”


Opening multiple projects in the IDE



For clarity, in this manual we only ever open and then edit a single project. The Curl IDE, however, supports the simultaneous opening of multiple projects.



2. Next, from the IDE “File” menu, select “New Project.” In the “New Project” dialog box, select “Applet Project” (1), input “Try2-1” (2), specify c:\Curl\lesson\Try2\01_control_action in the “Directory” field (3), set the API Version to 6.0 (4), and then click OK (5).


Inputting the Program

Next, we’ll input the program. You can copy the program code below or use c:\Curl\Try2\01_control_action\start.curl and then paste it into the editor in the IDE.

Code:
{CommandButton
    label = Push the button,
    {on Action do
        {popup-message Thank you!
        }
    }
}
{CheckButton
    label = Select the checkbox,
    {on ValueChanged at c:CheckButton do
        {if c.value then
            {popup-message Check is now on.}
         else
            {popup-message Check is now off.}
        }
    }
}

Save the File, and then Execute the Program

After inputting the code, save the file, and then execute the program. The following result will appear in your browser. Push the button and select the checkbox, while noting the results.


Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Page 8: Extra Practice ashimo 0 3,581 06-16-2011, 04:05 PM
Last Post: ashimo
  Page 7: Summary ashimo 0 3,056 06-16-2011, 03:57 PM
Last Post: ashimo
  Page 6: Let’s look at the make-up of this game ashimo 0 3,260 06-16-2011, 03:50 PM
Last Post: ashimo
  Page 5: Application... A “Push the Button in 10s” Game ashimo 0 3,213 06-16-2011, 03:33 PM
Last Post: ashimo
  Page 4: Structure of our program that uses events ashimo 0 2,906 06-16-2011, 03:30 PM
Last Post: ashimo
  Page 3: Using Different Events ashimo 0 3,127 06-16-2011, 03:25 PM
Last Post: ashimo
  Page 2: Structure of a Program that Displays Values input from Controls ashimo 0 3,015 06-16-2011, 02:18 PM
Last Post: ashimo
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('47')