{"assets":[],"author_link":"author\/jeremias\/","author_name":"Jeremias","cat":"LD #23","categories":["LD #23"],"comments":[],"epoch":1334572680,"event":"LD23","likes":0,"metadata":{"p_key":"76769","p_author":"Jeremias","p_authorkey":"0","p_urlkey":"284605","p_title":"I\u2019m in!","p_cat":"LD #23","p_event":"LD23","p_time":"1334572680","p_likes":"0","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1334880000","event_key":"10","event_name":"LD23"},"source_url":"2012\/04\/16\/im-in-510\/","text":"<p>I\u2019m in! Second time, using:<\/p>\n<ul>\n<li>\u00a0Language\/Framework: C# with XNA and an own library called GB2D presented in this post<\/li>\n<li>\u00a0IDE: Visual Studio 2010 C# Express<\/li>\n<li>\u00a0Graphics: GIMP, Inkscape<\/li>\n<li>\u00a0Sound and music: Sfxr, Autotracker (perlscript to generate random music), perhaps trying Otamata or Aviary (presented <a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/16\/some-useful-music-generators\/\">here<\/a>)<\/li>\n<\/ul>\n<p>Why do I program an own library for 2D games? There are a lot of things I could use, like FlatRedBall. But\u2026 programming primitive components makes fun and I learn a lot \u2013 that\u2019s all.<br\/>\n<span id=\"more-112763\"><\/span><br\/>\nHere we go. The framework is downloadable here:<br\/>\n<a href=\"http:\/\/www.stevencolling.de\/downloads\/public\/GameBase2D_16_04_12.zip\">http:\/\/www.stevencolling.de\/downloads\/public\/GameBase2D_16_04_12.zip<\/a><\/p>\n<p>One of two main parts is the agent modeling. Every entity in the game is modeled as an agent which you can extend by loading the components you need. Available components are:<\/p>\n<p><strong>Audible<\/strong>: Playing sounds.<br\/>\n<strong>Bodily<\/strong>: For physical information like position in the game world.<br\/>\n<strong>Collisionable<\/strong>: This components allows to use collision detection. Two implementations (CollisionableBoxed and CollisionableLine) of this class exists: box-collision and collision with a set of lines.<br\/>\n<strong>Logical<\/strong>: Used for game logic and agent\u2019s state.<br\/>\n<strong>Movable<\/strong>: Agent\u2019s moving abilities. An example implementation (MovableSimple) of this class allows to move an agent in 4 directions with a given speed.<br\/>\n<strong>Visual<\/strong>: For drawing the agent. An inheritance of this class (VisualAnimated) allows to load an animation and provides animation functionality like starting a specific one etc.<\/p>\n<p>So if you want to add a decorative element like a flying bee, you can initialize an agent with an own implementation of Audible (for humming), a Bodiliy component for positioning on the map, the Logical part to model the bee-specific flying in the game, a Movable part to allow moving in all directions and a VisualAnimated for drawing the bee.<br\/>\nA Collisionable component isn\u2019t needed so it is not initialized. A decorative tree would have no Movable component. An invisible entity like a spawnposition no Visual part.<\/p>\n<p>The second main part is a set of managers. Managers provide common and generic functionality:<\/p>\n<p><strong>DebugManager<\/strong>: provides debug textures and fonts for drawing debug things on the screen.<br\/>\n<strong>GameStateManager<\/strong>: handles the current state of game.<br\/>\n<strong>GuiManager<\/strong>: holds the GUI elements.<br\/>\n<strong>InputManager<\/strong>: manages the input from keyboard and gamepad. Allows to bind multiple keys to actions and set additional properties like a press lock, so an action is just triggered one time after pressing (the user must release the key and press it again to trigger an action again).<br\/>\n<strong>IntroManager<\/strong>: Shows a generic intro with name and that the game is used for the Ludum Dare competition.<br\/>\n<strong>MapManager<\/strong>: If the game has something like a map, this is used. It has just a MapSize attribute, an empty constructor, empty update and draw methods and a method to check if a given coordinate is within the map\u2019s bounds.<br\/>\n<strong>MusicManager<\/strong>: Allows to load music and to play (stop, pause etc.) it.<br\/>\n<strong>PlayerManager<\/strong>: Holds the player\u2019s controllable agents and was introduced for my network support (which is not part of the downloadable framework).<br\/>\n<strong>ScreenManager<\/strong>: This manager can handle multiple cameras on the map, different screens (split screen) and some methods to translate mapcoordinates to screencoordinates vice versa.<\/p>\n<p>Many of these managers are just \u201estubs\u201c, e.g. the GameStateManager \u2013 every game derives an xxxManagerImpl class to implement and overwrite the needed things, like introducing the game-related game state variables.<\/p>\n<p>Additional there are some basic classes summed up as \u201ecommon\u201c like basic math-method-wrappers in Util, a Line class or a Timer.<br\/>\nThe obligatory Game-class (Game2D) for XNA-games is also included. It initializes the managers and the framework itself.<br\/>\nA very funny thing is the Textbox functionality which I implemented last days. Now it is possible to show a conversation \u2013 multiple textboxes typical in old roleplay games. Even the continuous display of the text is added and available via configuration.<\/p>\n<p>There is also a sample project which sets up generic things like implementing the mentioned ManagerImpls. The IntroManagerImpl is fully implemented, because the Ludum Dare rules allow it. The Game1 class is filled with basic stuff, like setting up the empty and\/or generic managers. The correspondent Content project includes a folder-hierarchy. The only content is a little sound used in the intro and some fonts (for intro and debug purposes, the latter used in the DebugManager class).<\/p>\n<p>So if Ludum Dare starts, I will use the sample project, rename it and start implementing the Manager classes and agent components.<\/p>\n<p>Preparation done <img alt=\":D\" class=\"wp-smiley\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-includes\/images\/smilies\/icon_biggrin.gif\"\/> <\/p>\n<p>If I have the time until weekend, I try to add graphic shader functionality or lightning.<\/p>\n<div style=\"float: right;border: 1px solid #eee;padding: 2px;background: #fff;\"><div class=\"iLikeThis\" id=\"iLikeThis-112763\"><span class=\"counter-off\"><a class=\"image\" onclick=\"likeThis(112763);\">0<\/a><\/span><\/div><\/div>\n<p class=\"postmetadata alt\">\n<small>\n\t\t\t\t\t\tThis entry was posted\n\t\t\t\t\t\t\t\t\t\t\t\ton Monday, April 16th, 2012 at 10:38 am\t\t\t\t\t\tand is filed under <a href=\"http:\/\/www.ludumdare.com\/compo\/category\/ld-23\/\" rel=\"category tag\" title=\"View all posts in LD #23\">LD #23<\/a>.\n\t\t\t\t\t\tYou can follow any responses to this entry through the <a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/16\/im-in-510\/feed\/\">RSS 2.0<\/a> feed.\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tYou can <a href=\"#respond\">leave a response<\/a>, or <a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/16\/im-in-510\/trackback\/\" rel=\"trackback\">trackback<\/a> from your own site.\n\n\t\t\t\t\t\t\n\t\t\t\t\t<\/small>\n<\/p>","time":"April 16th, 2012 10:38 am","title":"I\u2019m in!"}