The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Monday project

From Allegro Wiki
Revision as of 21:22, September 22, 2008 by Matt Smith (talk | contribs) (Game Class)
Jump to: navigation, search

Intro

It's a Monday Project. it started on n http://www.allegro.cc/forums/thread/597566/ Webpage : http://www.zeoxdesign.com/monday/

Getting the game

You need to install Allegro 5 first. Guide for windows Installing_4.9_Windows

Then you need LUA 5.1. Helpful guide for Windows http://lua-users.org/wiki/BuildingLua

Then checkout the monday/trunk dir from SVN


<highlightSyntax language="bash">

 mkdir %your source dir%/monday
 cd  %your source dir%/monday
 SVN co http://svn.miquelfire.com/monday/trunk
 make
 ./monday  

</highlightSyntax>

Alternatively, you can replace make with scons, if you have that installed.

Games & Scripting

Design Team

  • Lead - 23yrold3yrold & Mark Oates

Maps

OnlineCop has been assigned the coding task. But he's slow.

File format

Format to be decided by programming team. 23yrold3yrold will make his editor spit out maps accordingly.

Interface

A script should be able to order a map switch.


Entities (Items & Objects & Characters)

  • Entity
    • Lua bindings
    • Set_function(action, function)
    • Set/get position
  • Entity_manager
    • Pick_up
    • Attack
    • Interact
    • Lua bindings
      • Create_entity
      • Destroy_entity

Location

    Map   -  every object is associated with the map it is on.  
    Parent Object -  An object may not be in plain view on the map, but may be  e.g. in a player's inventory
    x,y,z - In terms of the Map renderer or relative to the Parent Object      
    quat rot;  <-- may be handy here too, giving the same properties as LocRot in blender


This class is not in the code so far, but is a candidate to replace the Vector in Item, Character & Player

<highlightSyntax language="cpp"> class Locator { public:

  float Get_angle_256();              /* returns angle (in allegro degrees) on x,y plane from rot */
  void  Set_angle_256(float angle);   /* sets rot to angle (in allegro degrees) */
  float Get_map_distance(Locator& l2);   /* returns distance (in map units) to another locator.  This could be x,y for now */
  Map *   map;     /* Map that the Item is on */  
  Item *  item;    /* parent object.  set for an Item if it is attached to another Item or in a Player's inventory */
  Vector3  xyz;    /* position of Item in parent's axes */
  AL_QUAT  rot;    /* rotation of Item relative to parent */  

} </highlightSyntax>

Item* takes priority over Map* (they should ideally be merged into a single global object). If (item!=NULL) then xyz and rot are in parent-defined co-ords, otherwise they are in map co-ords


Inventory

Trezker's TODO

  • Inventory
    • Item management //No, it's pretty different from the Item_manager, so no inheritance please.
  • Inventory menu // Yes, this is a menu. Opened with some button in game.
    • Info about item // On mousover
    • Render function // Layout?
    • Equip // just a click; right click to bind to right mouse button, left to bind to left.
    • Use/Drop item // Low prio, this is not in design

Matt Smith: An inventory can be implemented as a map. An Item's location will have a parent which can be a Map, a Character , or even another Item.

Code

Loading and Saving

Trezker's TODO

  • Loading // Can use Init script for now
    • Map
    • Entities


Game Class

img:Game_interface.png


The interface between the Game and the system (Main.cpp) should do the following

<highlightSyntax language="cpp"> class Game() { public:

  Init();      /* This is called before any other Game method */ 
  NewGame(int num_Players);   /* Resets the game state to a new game */
  Run();       /* Sets the game state into power on/ menu mode */        
  Play();      /* Sets the game state into game playing mode */  
  Update();    /* This is called once per frame */
  Render();    /* The game draws the current frame onto display */
  int Get_frame_rate();    /* Returns the Games chosen refresh rate.  
                           Main uses this to decide how often to call Update() and Render() */

} </highlightSyntax>

initialisation

  A list of maps.
  A list of levels.  each level can take place over several maps
  A game state. 

game scripts

Menu Class

Trezker & Matt Smith are making a top level menu system, which will may be configurable by a LUA script

Contributors

Trezker