Unformatted text preview:

JAWS Language Reference Manual 1 Introduction The JAWS programming language was designed to provide a platform for casual and experienced game designers to rapidly prototype and develop space shooter genre video games The main focus behind the language was to eliminate the necessity for mastery of complex graphics and game physics implementation to allow the game designer to solely focus on game play design Thus the syntax and structure of the JAWS language strives for simplicity and ease of use 2 Lexical Conventions 2 1 Comments Comments are segments of code that the programmer wants the compiler to ignore Comments in the JAWS programming language are limited to one per line Comments must begin with and everything else on that line up to the carriage return n is treated as a comment 2 2 Whitespace In addition to comments blanks tabs and carriage returns are ignored except where they are used to separate tokens Tokens must be separated by at least one of the above 2 3 Identifiers Identifiers consist of a sequence of letters and digits and must start with a letter In addition to letters the underscore can also be used and counts as an alphabetic Identifiers represent the names that are given to declared data types that are used It is suggested that identifiers begin with a lowercase letter However this is not enforced syntax 2 4 Keywords The following list of identifiers are reserved in the JAWS language and may not be used otherwise int string boolean double constant if else for to by while entity movement attack point map show hide true false 2 5 Constants JAWS allows the use of 3 types of constants int string and double Constants are defined by typing the constant prefix before an identifier For example to define a constant called HIGH SCORE constant string HIGH SCORE 100 1 Constants retain their initial values and may not be changed during the execution of the program It is suggested that constants be named with all uppercase letters to distinguish them from identifiers However this is not enforced syntax 2 6 Separators The characters used as separators in JAWS are 2 7 Tokens Tokens are separated into identifiers constants keywords operators and other separators Tokens are defined greedily meaning the token is the longest un terminated recognized token type All tokens must be separated by whitespace 3 Data Types There are nine types of data in JAWS int double string boolean point entity movement attack and map 3 1 1 int Ints will be 32 bit two s compliant integers 3 1 2 double Doubles will be 64 bit double precision floating point numbers 3 1 3 string Strings will be a character string beginning with a and ending with a JAWS will not support the single char data type so for single characters strings can be used in the same way 3 1 4 boolean Booleans will be a true or false value 3 1 5 point Since locations and points are so prevalent in JAWS the point type is standard Points consist of two ints an x and a y which uniquely define the point The distance operator may be applied to point types facilitating the calculation of distance between points and entities Point type attributes may be directly accessed using the s operator Points are declared like a normal type and its x and y are defaulted to 0 Point has a built in initializer that takes in an int x and an int y which may be called to initialized x and y Here is an example point p will be at x 0 y 0 point p point p will be at x 6 y 4 point p point 6 4 Point Type Attributes Type Name int x int y Description x coordinate of the point y coordinate of the point 3 1 6 entity 2 Entities are objects that interact with each other during game play that are displayed to the user Each entity has a set of attributes that describe fully the entity s behavior and look Entities can be players monsters powerups labels and anything else that could appear on the map It is up to the programmer to correctly define their behavior Entity types in JAWS are all implemented as arrays This facilitates the easy duplication of a multiplicity of entities without repeated declaration and initialization When an entity class is created all entities in its array are created with the same values Each entity in the object array may be referenced and accessed individually thereafter When an entity is referenced with an index specified only that specific entity in the array is changed When an index is left out all entities in the array are affected Entity classes have special built in fucntions which facilitate game programming The distance operator can be applied on two entity classes and returns the distance between those two entities Entities also have show and hide functions Show is called to display the entity and to load its initializer Hide is called to unload the entity from display All attributes in a created entity class are set to default but can be initialized to different values in its initializer To define the entity s initializer define a function with the name of the entity without a return type The syntax for declaring an entity class and its initializer is as follows entity declaration entity name multiplicity entity initializer name attribute newvalue type name value initializing attributes adding user defined variables An example of creating a monster type called small alien of multiplicity 5 and setting its constructor to lay them across horizontally and creating user defined variables called hitpoints and pointValue entity small alien 5 small alien individually set each small alien s location for i 0 to 5 by 1 small alien i s location point i 2 0 set all small alien s hitpoints to 10 int hitpoints 10 3 int pointValue 100 show Entity Type Attributes Type Name int height int width point location string image attack weapon movement ai string label Description the height in cells of the entity on the map the width in cells of the entity on the map the location of the entity address of a supported image file to be used the attack class that the entity is equipped with the movement class to used to describe this entity a string to display using the entity as a label Entity Type Functions Name Description calculates the distance between two entities show displays the entity on screen and executes the entity s initializer the entity s movement ai also starts execution hide unloads the entity from the screen and all execution associated to that entity is halted 3 1 7 movement The movement type basically describes how an entity moves about the


View Full Document

Columbia COMS W4115 - JAWS Language Reference Manual

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view JAWS Language Reference Manual and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view JAWS Language Reference Manual and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?