Category:Functions

From Hack Wars Wiki

(Redirected from Functions)
Jump to: navigation, search
This Article is Incomplete
This article is apparently incomplete. You can help the HackWars wiki by expanding it



Contents

[edit] Compiling

After writing your script using the following functions you have to compile it to be able to use it. The base cost of compiling a script is $5.00.

[edit] General Functions

General functions will work in every API, although only a few work in Hacktendo API.

These functions work in all API except Hacktendo:

function(parameters) Description
printf(string s, args...) Returns the given string with the values of the variables provided in args appended onto it.
equal(string s1,string s2) Returns a boolean which represents if s1 is equal to s2.
toUpper(string s) Returns an upper-case version of the string provided.
toLower(string s) Returns an lower-case version of the string provided.
intValue(float value) Returns an integer of the value given.
floatValue(int value) Returns a float of the value given.
join(array array,string divider) Returns a string representing the array joined using the divider string provided.
split(string s1, string s2) Returns an array representation of s1 split into groups based on the string s2.
getTime() Returns a formated string representing the current time.
getDate() Returns a formatted string representing the current date.
length(array) Returns the number of elements in the array.


These functions work in all API, including Hacktendo:

function(parameters) Description
rand() Returns a float between 0 and 1.
indexOf(string s1, string s2, int n) Returns the position of s2 in s1 starting from the nth character.
replaceAll(string s1, string s2, string s3) Returns a string which has all instances of s2 in s1 replaced with s3.
char(int n) Returns a string containing a single character based on the integer given.
parseInt(string s) Turns a string into a integer.
parseFloat(string s) Turns a string into a float.
substr(string s, int start, int finish) Returns a substring starting at index 'start' and ending at the index 'finish'-1.
strlen(string s) Returns an integer representing the length of a string.
sqrt(float n) Returns the square root of n.


[edit] File I/O Functions

function(parameters) Description
clearFile(string file) Clears the contents of the text file pointed to by the filename (the full path is parsed).
readFile(string file) Reads all the content in a file.
readLine(string file, int line) Reads a single line in a file.
countLines(string file) Returns a int representing the number a lines in the file provided.
writeLine(string file, string data) Write new content into a file at the bottom.
writeFile(string file, string data) Clears all content in file and writes new content. If the file does not exist, it will attempt to create it.
fileExists(string file) Returns a boolean whether or not the file exists.


[edit] Redirecting Functions

function(parameters) Required Level Compile Cost CPU Cost Script Section Description
redirectDuctTape() 1 $20 1 Initialize Placed in the 'initialize' section of a Redirecting script, this function will allow you to redirect duct tape.
redirectGermanium() 25 $1,500 5 Initialize Placed in the 'initialize' section of a Redirecting script, this function will allow you to redirect Germanium.
redirectSilicon() 45 $6,000 10 Initialize Placed in the 'initialize' section of a Redirecting script, this function will allow you to redirect Silicon.
redirectYBCO() 75 $50,000 15 Initialize Placed in the 'initialize' section of a Redirecting script, this function will allow you to redirect YBCO.
redirectPlutonium() 85 $150,000 20 Initialize Placed in the 'initialize' section of a Redirecting script, this function will allow you to redirect Plutonium.


[edit] Banking Functions

function(parameters) Required Level Compile Cost CPU Cost Script Section Description
lowerDeposit(string ip, float amount) 1 $10 1 Deposit Deposits the amount specified into the bank of the player represented by the IP provided. lowerDeposit() takes the highest percentage in service charges and gives the least experience.
withdraw(string ip, float amount) 1 $10 1 Withdrawl Withdraws the amount specified into the petty cash of the player represented by the IP provided.
lowerTransfer(string targetIP, float amount) 1 $10 1 Transfer Transfers the amount specified to the petty cash of the player represented by the IP provided. lowerTransfer() takes the highest percentage in service charges and gives the least experience.
message(string ip, string message) 1 $10 1 Any Sends a message in the form of a string to the given IP address.
getAmount() 1 $10 1 Any Returns a float representing the amount that it has been requested be transfered, withdrawn, or deposited. Malicious programs may sometimes ignore this value (this value, however, represents an upper bound on how much can be withdrawn from the bank).
getSourceIP() 1 $10 1 Any Returns a string representing the IP of the computer attempting to perform the banking operation.
getTargetIP() 1 $10 1 Any Returns a string representing the IP of the computer to which a money transfer request has been submitted. (used by the various transfer methods).
getMaliciousIP() 15 $1,500 2 Any Returns the IP address of a computer that has hijacked this banking application. It is up to the programmer of the malicious application to decide how to act upon this information.
mediumDeposit(string ip, float amount) 25 $1,500 5 Deposit Deposits the amount specified into the bank of the player represented by the IP provided. mediumDeposit() takes a lower percentage in service charges and gives more experience.
mediumTransfer(string ip, float amount) 25 $1,500 5 Transfer Transfers the amount specified to the petty cash of the player represented by the IP provided. mediumTransfer() takes a lower percentage in service charges and gives more experience.
checkPettyCash() 25 $1,500 5 Any Returns a float representing the amount currently in the petty cash of the player being targeted with this attack.
checkPettyCashTarget() 25 $1,500 5 Any Returns a float value specified at runtime. This value can be used to decide, amongst other things, whether or not we should empty the opponent’s petty cash.
higherDeposit(string ip, float amount) 75 $6,000 10 Deposit Deposits the amount specified into the bank of the player represented by the IP provided. higherDeposit() takes a lower percentage in service charges and gives more experience.
higherTransfer(string targetIP, float amount) 75 $6,000 10 Transfer Transfers the amount specified to the petty cash of the player represented by the IP provided. higherTransfer() takes a lower percentage in service charges and gives more experience.
greaterDeposit(string ip, float amount) 95 $100,000 20 Deposit Deposits the amount specified into the bank of the player represented by the IP provided. greaterDeposit() takes a lower percentage in service charges and gives more experience.
greaterTransfer(string targetIP, float amount) 95 $100,000 20 Transfer Transfers the amount specified to the petty cash of the player represented by the IP provided. greaterTransfer() takes a lower percentage in service charges and gives more experience.


[edit] Attacking Functions

function(parameters) Required Level Compile Cost CPU Cost Script Section Description
showChoices() 1 $5 1 Finalize Prompts the GUI to display a list of malicious actions that can be taken upon finishing an attack.
getSourceIP() 1 $5 1 Any Returns a string representing the IP address of the computer performing an attack.
message(string ip, string message) 1 $10 1 Any Sends a message in the form of a string to the given IP address.
getTargetIP() 5 $10 1 Any Returns a string representing the IP address of the computer being targeted with an attack.
getTargetPort() 5 $10 1 Any Returns the port being targeted by this attack.
getSourcePort() 5 $10 1 Any Returns the port that is running this attack.
getCPULoad() 10 $10 2 Any Returns a float representing the current load in CPU units of the computer performing the attack.
cancelAttack() 10 $50 2 Any Cancels the attack currently being performed.
getIterations() 15 $150 2 Any Returns an int representing how many times the continue function has been called (how many iterations the attack has had) .
installScript() 15 $250 5 Finalize Installs a malicious script on the port being attacked (must be called when port being attacked is in a weakened state) .
emptyPettyCash() 15 $250 5 Finalize Steals any money in the petty cash of the player being attacked; this only works when the port being attacked is a banking port (must be called when port being attacked is in a weakened state) .
changeDailyPay(string ip) 15 $250 5 Finalize Used in finalize to automatically set the opponents daily pay target to the IP provided
getMaximumCPULoad() 25 $500 2 Any Returns a float representing the current maximum load of CPU units for the player running an attack.
getHP() 25 $500 5 Any Returns a float representing the hit-points of the port performing an attack.
getTargetHP() 35 $1,500 3 Any Returns a float representing the hit-points of the port being targeted with an attack.
berserk() 40 $1,500 5 Continue Perform a double attack, but also hurt your own port.
deleteLogs() 45 $1,000 4 Finalize Deletes all the logs associated with your IP in the player’s logging DB.
editLogs(string original,string replacement) 55 $1500 4 Finalize Replaces all instances of the original string in the opponent's log with the replacement string.
switchAttack() 50 $1,000 10 Continue Switches an attack from targeting the current port to targeting the next port in an array of secondary targets.
checkForWatch() 50 $2,000 5 Any Returns a boolean stating whether or not a watch is observing the port being attacked.
isZombie() 60 $500 Any Returns a boolean value indicating whether or not the attack currently taking place is being controlled remotely or not.
checkPettyCash() 60 $750 8 Any Returns a float representing the amount currently in the petty cash of the player being targeted with this attack.
checkPettyCashTarget() 60 $750 8 Any Returns a float value specified at runtime. This value can be used to decide, amongst other things, whether or not we should empty the opponent’s petty cash.
zombie(string ip) 60 $2,000 0 Initialize Allows a player associated with the string ip to remotely hook into a player’s attack program. This function should be placed in initialize .
freeze() 65 $2,500 10 Continue Temporarily disables the port being attacked. This round of an attack deals no damage.
stealFile() 70 $3,000 7 Finalize Used in finalize, stealFile() automatically takes a file from the opponent's computer (rather than using the file selection dialog).
getTargetCPUCost() 85 $10,000 15 Any Returns a float representing the CPU cost of the port being targeted with an attack.
destroyWatches() 95 $300,000 25 Finalize Destroys any watches on the opponent’s computer observing the port being attacked (must be called when port being attacked is in a weakened state) .


[edit] Watch Functions

function(parameters) Required Level Compile Cost CPU Cost Script Section Description
message(string ip, string message) 1 $10 1 Fire Sends a message in the form of a string to the given IP address.
getTargetIP() 1 $250 1 Fire Returns a string representing the IP address of the player that caused this watch to fire.
getPort() 1 $250 1 Fire Returns the port that this watch is observing.
getSourceIP() 1 $250 1 Fire Returns a string representing the IP address of the player that has this watch installed.
getTargetPort() 1 $250 1 Fire Returns an int representing port number on the opponent’s computer that caused this watch to fire.
logMessage(string message) 1 $50 1 Fire Puts a message in your log window.
sendFacebookMessage() 1 $50 1 Fire Puts a message in your Facebook profile.
getTransactionAmount() 5 $250 1 Fire Returns the amount of money that caused a petty cash watch to fire.
checkFireWall(string firewall) 5 $100 2 Fire Takes a string as input representing the type of fire wall to check for, one of: nofirewall, basicfirewall, mediumfirewall, greaterfirewall, basicattackingfirewall, mediumattackingfirewall, greaterattackingfirewall, ultimateattackingfirewall. Returns a boolean representing whether or not this type of fire wall is installed on the port being observed.
switchAnyFireWall() 10 $500 5 Fire Checks the secondary array of ports being observed by this watch for any fire wall. This fire wall is moved to the primary port that caused this watch to fire.
getCPULoad() 10 $250 2 Fire Returns a float representing the current load in CPU units of the computer that had this watch fired.
checkForFireWall() 15 $250 3 Fire Given a string representing a fire wall constant (see checkFireWall()) , returns an int representing the number of a secondary port being observed by this watch that has the given fire wall installed on it (returns -1 otherwise)
switchFireWall() 15 $250 3 Fire Takes an int as input representing a port number in the array of secondary ports being observed. The fire wall on this secondary port is switched onto the port that caused this watch to fire.
getMaximumCPULoad() 20 $1,000 2 Fire Returns a float representing the maximum load of CPU units of the computer that had this watch fire.
getSearchFireWall() 20 $500 2 Fire Returns a string constant, specified by the user, that represents a fire wall that should be searched for by checkForFireWall() , see checkFireWall() for constants.
checkPettyCash() 25 $1,000 4 Fire Returns a float representing the amount in the petty cash of the player’s computer that had this watch fire.
isTriggered() 35 $1,000 2 Fire Returns whether or not this watch actually fired or whether it was caused by a trigger event (either in HTTP or in a game).
getTriggerParameter() 35 $1,000 2 Fire Returns the variable associated with the key sent along with triggerWatch().
transferMoney() 40 $2,000 5 Fire Transfers the amount indicated to the player represented by the IP.
sendEmail() 35 $1,000 5 Fire Sends you an email with the message provided. This function takes $100 to run.
scan(string ip) 45 $2,500 5 Fire Scan takes an IP as input and performs a scan on the target
attack(int yourPort, string targetIP, int targetPort) 50 $10,000 10 Fire Launches an attack from the port indicated against the player and port provided. Note: This can only be run using triggerWatch() in HTTP.
counterattack() 50 $10,000 10 Fire Starts a counter attack against the player’s port that caused this watch to fire (The port provided is used to mount the attack.)
cancelAttack() 50 $10,000 4 Fire Cancels an attack taking place on the port indicated.
zombieAttack() 55 $15,000 10 Fire Launches an attack from the zombie and port indicated against the opponent represented by the IP and port. Note: This can only be run using triggerWatch() in HTTP.
counterattackBank() 60 $15,000 12 Fire Starts an attack against the opponent’s default banking port (The port provided is used to mount the attack.)
counterattackAttack() 60 $15,000 12 Fire Starts a counter attack against the opponent’s default attacking port (The port provided is used to mount the attack.)
getDefaultBank() 60 $15,000 2 Fire Returns an int representing the port that a player currently has set as their default bank.
getDefaultAttack() 60 $15,000 2 Fire Returns the default attacking port associated with this computer.
getDefaultFTP() 60 $15000 2 Fire Returns an int representing the port that a player currently has set as their default FTP.
getDefaultHTTP() 60 $15,000 2 Fire Returns an int representing the port that a player currently has set as their default HTTP.
shutDownWatch() 65 $2,000 8 Fire Turns off the watch represented by number.
turnOnWatch() 65 $2,000 8 Fire Turns on the watch represented by number.
shutDownPort() 75 $10,000 15 Fire Takes an int as input representing the port number of a port in the array being observed. This port is turned off .
heal() 75 $10,000 15 Fire Heals the port that is being observed by this watch (same price as manual healing) .
shutDownPorts() 80 $25,000 20 Fire Attempts to shutdown all the ports in the array of secondary observed ports associated with this watch.
turnOnPort() 75 $10,000 15 Fire Takes an int as input representing the port number of a port in the array being observed. An attempt is made to turn this port on.
turnOnPorts() 80 $25,000 20 Fire Attempts to turn on all the ports in the array of secondary observed ports associated with this watch.
depositPettyCash(float amount) 95 $100,000 25 Fire Automatically deposits money equal to amount specified from the player’s petty cash into their bank, as a defensive measure.


[edit] FTP Functions

function(parameters) Compile Price CPU Usage Description
message(string ip, string message) $50 2 Sends a message in the form of a string to the given IP address.
put(string ip) $50 2 Put takes a string as input representing the computer that a file should be transferred to (the file and the target directory are given at runtime).
get(string ip) $50 2 Get takes a string as input representing the computer that a file should be transferred to (the file and the target directory are given at runtime).
getTargetIP() $50 2 Returns a string representing the IP address of the computer that it has been requested an FTP action be taken upon.
getMaliciousIP() $500 2 Returns the IP address of a computer that has hijacked this FTP application.
getFileName() $800 2 Returns a string representing the name of the file being transfered.
getFileType() $1,600 2 Returns a string representing the type of file being transfered (compiled, script, firewall, image, or text).
getFilePrice() $3,000 2 Returns a float representing the asking price of the file being transfered.


[edit] HTTP Functions

function(parameters) Required Level Compile Cost CPU Usage Script Section Description
message(string ip, string message) 1 $10 1 Any Sends a message in the form of a string to the given IP address.
getVisitorIP() 1 $10 1 Any Returns a string representing the domain or IP address of the player that visited your site.
getHostIP() 1 $10 1 Any Returns a string representing the IP address of the player that hosting the site.
logMessage(string message) 1 $50 1 Any Puts a message into your log database.
popUp(string message) 5 $250 2 Any Popups a message on a visitors screen.
getParameter(string variableName) 20 $100 1 Any Gets a variable from a form on your site. Name is gotten from the form. ie. <input type="text" name="var">. To get this parameter you would use getParameter("var");
triggerWatch(int number, string key1, variable var1 ... keyN,variable varN) 30 $1,000 3 Any Triggers the watch indicated passing along the variables provided associating them with the keys (in a watch these can be fetched using getTriggerParameter()).
replaceContent(string key, string content) 30 $250 1 Any In your web-page content you can place the tag <?some_key?>. You can dynamically replace the content of this tag using replaceContent(). In this case replaceContent("some_key","my new content") would replace the instance of "<?some_key?>" with "my new content". The key can, of course, take on any value.
turnOnWatch(int number) 30 $1,000 3 Any Turns on the watch associated with the number provided.
fetchGetVariable(string key) 35 $500 1 Any You can indicate variables in the URL of the web-page you are going to, e.g., hackstock.hw?ip=132&name=ben. These consist of key value pairs, where, for instance, 'name' and 'ip' are keys and '132' and 'ben' are values. Using fetchGetVariable() you can fetch the values by providing a key.
hideStore() 40 $1,500 6 Any Blocks the current visitor from seeing your store.


[edit] Challenge Functions

function(parameters) Description
abs(float) Returns the absolute value (in the form of a float) of the float provided.
acos(float) Returns the arc-cosine of the float provided.
asin(float) Returns the arc-sine of the float provided.
atan(float) Returns the arc-tangent of the float provided.
cos(float) Returns the cosine of the float provided.
sin(float) Returns the sine of the float provided.
tan(float) Returns the tangent of the float provided.
getE() Returns the mathematical constant e in the form of a float. For a better explanation of e, see ln().
getInputFloat() Returns the next float in an array of floats provided by a challenge system. This is one of the functions used to return challenge data (along with getInputString() and getInputInt()) and as such each instance of this function will return the next element in the challenge array. Because of this the challenge data is volatile and should be stored in a variable after each instance.
getInputFloatCount(float) Returns an integer representing the initial number of elements in an array of floats provided by the challenge system. This is one of a group of functions used to return challenge data (along with getInputStringCount() and getInputIntCount()).
getInputInt() Returns the next integer in an array of integers provided by a challenge system. This is one of the functions used to return challenge data (along with getInputString() and getInputFloat()) and as such each instance of this function will return the next element in the challenge array. Because of this the challenge data is volatile and should be stored in a variable after each instance.
getInputIntCount() Returns an integer representing the initial number of elements in an array of integers provided by the challenge system. This is one of a group of functions used to return challenge data (along with getInputStringCount() and getInputFloatCount()).
getInputString() Returns the next string in an array of strings provided by the challenge system. This is one of the functions used to return challenge data (along with getInputFloat() and getInputInt()) and as such each instance of this function will return the next element in the challenge array. Because of this the challenge data is volatile and should be stored in a variable after each instance.
getInputStringCount() Returns an integer representing the initial number of elements in an array of strings provided by the challenge system. This is one of a group of functions used to return challenge data (along with getInputFloatCount() and getInputIntCount()).
getPI() Returns the value of the mathematical constant PI in the form of a float.
ln(float) Returns the natural logarithm of the (float) parameter in the form of a float.
setOutputFloat(float) Passes the parameter (a float or a float variable) to the challenge system. This is one of the functions used to end challenges (along with setOutputString() and setOutputInt()) and as such will only appear at the end of a challenge program.
setOutputInt(int) Passes the parameter (an integer or an integer variable) to the challenge system. This is one of the functions used to end challenges (along with setOutputString() and setOutputFloat()) and as such will only appear at the end of a challenge program.
setOutputString(string) Passes the parameter (a string) to the challenge system. This is one of the functions used to end challenges (along with setOutputFloat() and setOutputInt()) and as such will only appear at the end of a challenge program.
sqrt(string) Returns a float representing the positive square root of the provided float


[edit] Hacktendo Functions

Merged Hacktendo 2D/3D functions into one list, since the whole thing now works in 3D.

function(parameters) Description
setXSpeed(int speed) Sets the scroll speed of the game window in the x direction, used for smooth scrolling transitions.

Deprecated: Using setViewportX() and setViewportY() seems to work better.

setYSpeed(int speed) Sets the scroll speed of the game window in the y direction, used for smooth scrolling transitions.

You can setup and check timestamps to use an actual timing mechanism for sprite movement, etc

deleteTimeStamp(string key) Deletes a time stamp.
checkTimeStamp(string key) Returns the time in milliseconds that has passed since the creation of the time stamp associated with the key.
createTimeStamp(string key) Creates a timer and associates it with the key.

Functions that don't provide the ID assume that the script associated with the sprite running the given script is the target. Most sprite getters and setters have these two types of methods.

getX(int id) Returns x position of sprite associated with ID.
getY(int id) Returns x position of sprite associated with ID.
getZ(int id) Returns z position of sprite associated with ID. [0,1,2] 0 being the farthest back layer. This determines drawing order.
getFrame(int id) Returns the current cell of the sprite being rendered [0-7]. Each sprite has eight animation cells, get and set frame can be used to create animation effects.
getImage(int id) Returns the current 8 cell image associated with the sprite. It is possible to change the sprites image and script, allowing you to create fairly complex sprites.
getScript(int id) Returns the current script ID associated with the sprite.
setX(int id, int x or int x) Sets the current x position of a sprite, in world coordinates.
setY(int id, int y or int y) Sets the current y position of a sprite, in world coordinates.
setZ(int id, int z or int z) Sets the current z position of a sprite, in world coordinates.
setFrame(int id, int frame or int frame) Sets the current animation frame of the sprite [0-7]
setImage(int id, int image or int image) Set the current 8 frame image associated with the sprite.
setScript(int id, int scriptID) Sets the script currently associated with a given sprite.
setWidth(int id, int width or int width) Sets the width of the sprite, used by the collision handling system.
setHeight(int id, int height, or int height) Sets the height of the sprite, used by the collision handling system.
setCollisionType(int id, int type, or int type) Sets the type used by the collision system. 0: Pixel Based 1: Rectangular.
setGlobal(string key,(int,string,float,boolean)) Sets a global variable that can be accessed from any script via the key.
getGlobal(string key) Returns the global variable associated with the key.
setLocal(string key,[int,string,float,boolean]) Sets a local variable that can be accessed from any script via the key.
getLocal(string key) Returns the local variable associated with the key. Each sprite can keep track of their own variables.
isGlobalSet(string key) Returns whether the global variable represented by key has been set or not.
isLocalSet(int spriteID, string key or string key) Returns whether the local variable represented by key has been set or not.

Keyboard events come in the form of lists that you should iterate through using a loop, this way if more than one key is pressed at a time, things are cool.

getKeyUpCount() Returns the number of keys that a player has stopped pressing down since the last time the key handler was accessed.
getKeyDownCount() Returns the number of keys that a player has pressed down since the last time the key handler was accessed.
getNextKeyUp() Returns the integer value of a key recently depressed by a player... this removes it from the queue (e.g, you should do key handling in one location).
getNextKeyDown() Returns the integer value of a key currently being pressed by a player... this removes it from the queue (e.g, you should do key handling in one location).

You can send messages between sprites much like a key event message. Iterate through a sprite's messages to get all of them.

messageSprite(int spriteID,String flag,Object message) Messages a sprite referenced by id with a flag and value.
getMessageCount() returns the number of messages received.
getCollidedCount() returns the number of collisions since last frame.
getFlag() Returns the flag for the current message.
getMessage() Returns the current message.
nextMessage() Moves message queue to next message.
createSprite(int imageID,int scriptID,int x,int y,int z) Returns the sprites ID.
destroySprite(int spriteID) Destroys the sprite.
getID() returns the sprites id.
changeMap(int mapID,int scriptID) Changes the map to the map in your resource handler indicated by mapID, and loads the script alluded to by scriptID.
setMusic(int musicID) Changes the background music.
playSound(int soundID) Plays the sound.
nextCollided() Moves to collision queue to the next collision.

Collision also works based on an array. If something has hit one of your sprites it will be given the ID of the sprite that had collided with it, move through the list in a while loop to see everything it collided with

collidedWith() Returns the sprite or tile ID of the object collided with.
collidedType() Returns the type collided with. 0 for a sprite, 1 for a tile.
save(string key, object value) creates a key-value pair to be saved in a save game file on players virtual HD.
load(string key) Loads a value from a save game file on players virtual HD based off a key.
getMapID() Returns the current map id.
triggerWatch(string note) Triggers a watch on makers computer based on the note of the watch. It triggers based on the note that you set on your watch.
isPassable(int x, int y) returns whether the tile at position (x,y) on map is passable or not.
setViewportX(int x) Sets the map X value for display to screen.
getViewportX() Returns the current map X value for display to screen.
setViewportY(int y) Sets the map Y value for display to screen.
getViewportY() Returns the current map Y value for display to screen.
setViewportZ(int height) Sets the height of the viewport from the ground.
getViewportZ() Returns the height of the viewport from the ground.
drawRectangle(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws a rectangle on the screen based on screen (x,y). Color values range from 0-255.
fillRectangle(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws a filled rectangle on the screen based on screen (x,y). Color values range from 0-255.
drawText(String text,String font,int fontSize,int x,int y,int red,int green,int blue,int alpha) Draws text on the screen based on screen (x,y). Color values range from 0-255.
drawLine(int x1,int y1,int x2,int y2,int red,int green,int blue,int alpha) Draws a line on the screen based on screen (x,y). Color values range from 0-255.
drawOval(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws an oval on the screen based on screen (x,y). Color values range from 0-255.
fillOval(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws a filled oval on the screen based on screen (x,y). Color values range from 0-255.
drawArc(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws an arc on the screen based on screen (x,y). Color values range from 0-255.
fillArc(int x,int y,int width,int height,int red,int green,int blue,int alpha) Draws a filled arc on the screen based on screen (x,y). Color values range from 0-255.
debug(string message) Sends a message to "Game Messages" tab.
sqrt(float value) Returns the square root of value.
abs(float value) Returns the absolute value of value.
tan(float angle) Returns the tangent of the angle.
cos(float angle) Returns the cosine of the angle.
sin(float angle) Returns the sine of the angle.
atan(float angle) Returns the arctangent of the value.
acos(float angle) Returns the arc cosine of the value.
asin(float angle) Returns the arc sine of the value.
rand() Returns a random value between 0-1.
floor(float value) Returns the integer value of value rounded down.
pow(float value, float exponent) Returns the value of value to the power of exponent.
intValue(float value) Returns the integer value of value.
drawTextWorld(String text,String font,int fontSize,int x,int y,int red,int green,int blue,int alpha) Draws text on the screen based on world (x,y). Color values range from 0-255.
drawRectangleWorld(int x,int y,int red,int green,int blue,int alpha) Draws a rectangle on the screen based on world (x,y). Color values range from 0-255.
fillRectangleWorld(int x,int y,int red,int green,int blue,int alpha) Draws a filled rectangle on the screen based on world (x,y). Color values range from 0-255.
getViewportXRotation() Returns the current X angle of the viewport.
setViewportXRotation(int angle) Sets the viewport angle with respect to the X axis to the provided angle.
getViewportYRotation() Returns the current Y angle of the viewport.
setViewportYRotation(int angle) Sets the viewport angle with respect to the Y axis to the provided angle.
getViewportZRotation() Returns the current Z angle of the viewport.
setViewportZRotation(int angle) Sets the viewport angle with respect to the Z axis to the provided angle.
getRenderType(int spriteID) Returns the integer of the shape the sprite is currently rendered as.
setRenderType(int spriteID, int renderType) Changes the way a sprite is rendered (and the shape). There are three options: 0 makes it a flat 2D sprite, 1 makes it a sphere, 2 makes it a cube, 3 is a cone.
getXRotation(int sprite) Returns the current X angle of the given sprite.
setXRotation(int sprite, int angle) Sets a sprites angle with respect to the X axis.
getYRotation() Returns the current Y angle of the given sprite.
setYRotation(int sprite, int angle) Sets a sprites angle with respect to the Y axis.
getZRotation() Returns the current Z angle of the given sprite.
setZRotation(int sprite, int angle) Sets a sprites angle with respect to the Z axis.
getAutoCollide() Coming soon.
setAutoCollide() Coming soon.
setMask(int red, int green, int blue, int alpha) Coming soon.
setDepth(int depth) Coming soon.
getPassable() Coming soon.
setPassable(int x, int y, boolean isPassable) Coming soon.
getTile() Coming soon.
setTile() Coming soon.
setOffscreenProcessing(int spriteID, boolean doProcessing) Coming soon.
setZOffset(int spriteID, int zOffset) Coming soon.
getViewportWidth() Returns the current width of the Hacktendo viewport in pixels.
getViewportHeight() Returns the current Height of the Hacktendo viewport in pixels.
setTerrain(int tile) You can use one of your 128 64x64 tiles as the terrain, this should be a black and white image where white represents the highest possible point and black the lowest.
setIgnoreTerrain() takes boolean will make an object ignore the terrain's height when it is being placed.
setRepeatTexture() If you stretch the size of an object this can make the texture repeat over and over. Takes a boolean value.
getTerrainHeight(int x, int y) Returns the height of the terrain at this point on the map (0 - 255).
getMouseScreenX() Returns the mouse pointer's X position in screen coordinates.
getMouseScreenY() Returns the mouse pointer's Y position in screen coordinates.
getMouseWorldX() X of mouse in world coordinates.
getMouseWorldY() Y of mouse in world coordinates.
getMouseWorldZ() Z of mouse in world coordinates.
getMouseTileX() The X position of the tile the mouse is over in tile coordinates.
getMouseTileY() The Y position of the tile the mouse is over in tile coordinates.
getMouseDown() Is a mouse button currently down.
getMouseClicked() Has the mouse been clicked.
setCollideWithWater() Should the sprite be allowed to walk on water.
setMaxStepUp() How far up can a sprite step in coordinates when walking from lower to higher terrain.
setMaxStepDown() How far down can a sprite step when stepping from higher to lower terrain.
setRenderWater(boolean render) Enables/Disables the drawing of water in Hacktendo.
setRenderShadows(boolean render) Enables/Disables the drawing of shadows in Hacktendo.
setSky(int sky) Should a sky be drawn, 0 none, 1 blue sky, 2 night, 3 storm.
setWaterHeight(int waterLevel) How high off the ground should the water layer be drawn.
explodeSprite() Explode the sprite provided (this does not destroy the sprite call explode then destroy sprite for this.).

Subcategories

There is one subcategory to this category.

F

Pages in category "Functions"

There are 189 pages in this category.

A

B

C

D

E

F

G

G cont.

H

I

J

L

M

P

R

R cont.

S

T

W

Z

Personal tools