Hacktendo

From Hack Wars Wiki

Jump to: navigation, search

Contents

Introduction

Hacktendo allows players to create and sell their own arcade games from within HackWars. To use the hacktendo to play the games you must be logged in the opengl version, otherwise you might have to relog.

We hope that, as games are created, this will become a fun way to pass the time. What kind of games can you create? We've provided an abstract API that should keep the options pretty open. I, for instance, created a space game.

Specifications

  • Create up to 64 64x64 by 8 frame sprites (You can create multiple copies of each at runtime).


  • Draw maps using up to 128 64x64 tiles of your choosing (grass, dirt, grass, etc).
  • Images have to be png, gif or jpg.
  • Create up to 9 different 45x24 tile maps.
  • Create an unlimited number of scripts to attach to your sprites and to your levels.

Making a Game

Creating a game is simple:

  1. You create and load in a bunch of resources.
  2. You create a bunch of scripts that access these resources.
  3. Magic happens.

Scripts themselves are simple and are split into two categories:

Map Scripts

A map script is called when your game first starts it takes care of loading resources, and monitoring various game attributes. Like other scripts in Hack Wars it does this based on entry points. There are three entry-points:

Initialize:

This is called when a level first loads, and is mainly used for initializing your level, so:

  • Loading in sprites using createSprite().
  • Setting global variables.
  • Positioning the screen using setViewportX() and setViewportY() to the appropriate location etc...

Continue:

Continue is called at a rate of 20FPS. You can use this block of code to: draw a HUD, monitor global variables, take keyboard input, etc. Do not control sprite variables here, we will get to this.

Finalize:

Called when your script is shutdown, used for saving etc, not yet implemented.

Sprite Scripts

A sprite itself, once created, can be thought of a single object with many variables attached to it... these can mostly be changed on the fly using the API. createSprite() returns an integer ID which from that point forward can also be used to refer to the sprite. A sprite has:

  • A global x and y position based on the maps coordinate system.
  • An 8 frame image which is rendered, and can be changed.
  • A script that runs at a rate of 20FPS, and can be changed.
  • An animation variable which indicates which frame of the image should be rendered.
  • Local variables for keeping track of other attributes you set.
  • Probably several other things I'm forgetting.

The actual script you set for the sprite has only one entry point fire and in this script you perform actions like moving the sprite, checking collision detection (which is done for you via collision messages), perform animation (by advancing frames), and any number of other things.

Some Concluding Thoughts

Making a game in Hacktendo isn't for the faint hearted, it takes hard work, and some knowledge of programming. We are going to work on tutorials, and on other GUIs for making the game creation easier. This having been said, the best way to get going with the Hacktendo game creation process is by talking with fellow players, and starting to get a community going. I hope to see some awesome games real soon.

Personal tools