G! A programming language for 2D games Rachit Parikh [email protected] Arora [email protected] Lianoglou [email protected] Ray [email protected]Game Development – Tedious and complicated affairLots of repetitive code and bookkeeping to ensure a proper functionalityFor example: check when 2 objects collide, check when a key is pressed, handle an event, …MotivationHence G!Specifically for 2D gamesAllow the developer to focus on game play and targetBookkeeping handled at the backendIntuitive commands, minimal keywords, high flexibilityImplementationBased on the GTGE LibraryLibrary takes care of a lot of basic gaming functionality but it’s still Java – lengthy, redundant codeCompiler Structure:ImplementationG! WalkerPhase 1: Initializing symbol tables and other data structuresPhase 2: Type checking expressions, forward declarations of variables and functionsG! TranslatorCode GenerationInvoke javac compilerG! v/s its Java Equivalent G! is free form, Java is notG! programs involve: variable declarations and assignmentsfunction definitions if-else statements while and for loops an asynchronous statement type “when”Its Java Equivalent Game class that includes:Class level declarationsInitializations and setting the gamefield withing initResources()An update method : the asynchronous event checksA render methodMain method that launches gameClasses to handle collisionsCompiler Goals Find the collection of different statement types in the programPreserve the scope of each of these collections.Know what to do with each of these objects in the collection typesStatic/ semantic analysis of the programGenerate a java equivalentOur solution Block GbScopeContainerFunction When if forLessons LearntLanguage development requires careful planning and analysisBefore using any library, be sure to study it inside outDeal with the harder things first. Keep the simple stuff for later.Better time management to avoid the sleepless nights before
View Full Document