Code Monkey home page Code Monkey logo

dragonfruit-game's People

Contributors

dom96 avatar gbaman avatar

Watchers

 avatar  avatar  avatar

Forkers

dom96

dragonfruit-game's Issues

Game loop doesn't cease when game is left

It appears that the game loop continues to run even when the game is stopped.

To reproduce:

  • Start the game by pressing "Start game".
  • Click the back button
  • Observe that the "Current FPS" is still logged, but now much faster (likely the game loop is started again causing two to be running)

Level creation

I was doing some thinking today about how we handle levels and have an idea to propose.
A single level class from which most of its needed data is grabbed from a few supporting files.

  • LevelBackground.png - Background image
  • LevelPath.png - Main path file making use of PNG transparency
  • LevelForeground.png - Foreground image, bridges etc.
  • LevelObjects.xml - Simple XML file with a series of coordinates along with image names, sound effect names (for when hit) and class names. These would be for anything that isn't drawn in the first 3 images, for example powerup boxes etc.
    It would be possible to have more than just physical objects though in the LevelObjects.xml file, could easily also have triggers. So when a user reaches a certain point, a piece of code is run.

When setting up the new level, would have a constructor like
Level(LevelData, LevelObjects, LevelMusic)
Or if wanted to allow each to be defined individually.
Level(LevelBackground, LevelPath, LevelForeground, LevelObjects, LevelMusic)

We could easily build a simple tool to generate the LevelObjects.xml file, I already have a rough thing from a previous project written in Python.

The advantage of this is it allows us to build levels quickly and in theory, supports dynamically built levels later on, given is just some images and an xml file. This is all opposed to a class for each level.

What do we think @dom96 @nmcparland?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.