skip to main content
10.1145/2643135.2643160acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
tutorial

Declarative Game Programming: Distilled Tutorial

Published:08 September 2014Publication History

ABSTRACT

Video games are usually not programmed very declaratively. There are a number of reasons for this, from low-level efficiency concerns, via the nature of commonly employed programming languages, libraries, and frameworks, to the conceptual nature of such games, with state and effects being omnipresent. However, by structuring games in terms of time-varying values and transformations on such values, it is possible to design and implement video games in a more declarative way. This tutorial shows how this can be achieved through Functional Reactive Programming (FRP) by implementing the high-level parts of a 2D game akin to the classical game Breakout. The tutorial uses the Haskell-embedded FRP implementation Yampa and bindings to SDL (Simple DirectMedia Layer) to obtain game play and visual standards typical of the 2D genre; for example, as seen in many currently popular games for smartphones and tablets.

References

  1. P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice. LUSTRE: A declarative language for programming synchronous systems. In Proceedings of the 14th ACM Symposium on Principles of Programming Languages, New York, NY, 1987. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. H. Cheong. Functional programming and 3D games. BEng thesis, University of New South Wales, Sydney, Australia, Nov. 2005.Google ScholarGoogle Scholar
  3. A. Courtney, H. Nilsson, and J. Peterson. The Yampa arcade. In Proceedings of the 2003 ACM SIGPLAN Haskell Workshop (Haskell'03), pages 7--18, Uppsala, Sweden, Aug. 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Elliott and P. Hudak. Functional reactive animation. In Proceedings of ICFP'97: International Conference on Functional Programming, pages 163--173, June 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Hughes. Generalising monads to arrows. Science of Computer Programming, 37:67--111, May 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Proceedings of the 2002 ACM SIGPLAN Haskell Workshop (Haskell'02), pages 51--64, Pittsburgh, Pennsylvania, USA, Oct. 2002. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Paterson. A new notation for arrows. In Proceedings of the 2001 ACM SIGPLAN International Conference on Functional Programming, pages 229--240, Firenze, Italy, Sept. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Declarative Game Programming: Distilled Tutorial

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PPDP '14: Proceedings of the 16th International Symposium on Principles and Practice of Declarative Programming
        September 2014
        288 pages
        ISBN:9781450329477
        DOI:10.1145/2643135

        Copyright © 2014 Owner/Author

        Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 8 September 2014

        Check for updates

        Qualifiers

        • tutorial
        • Research
        • Refereed limited

        Acceptance Rates

        PPDP '14 Paper Acceptance Rate22of43submissions,51%Overall Acceptance Rate230of486submissions,47%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader