Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
This is a port of flixel to the Monkey language
Monkey ActionScript Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bananas @ 821e8a3
data
flxtext
native
plugin
system
tests
.gitignore
.gitmodules
LICENSE
README.md
flixel.lmbs
flixel.monkey
flxbasic.monkey
flxbutton.monkey
flxcamera.monkey
flxemitter.monkey
flxextern.monkey
flxg.monkey
flxgame.monkey
flxgroup.monkey
flxmusic.monkey
flxobject.monkey
flxparticle.monkey
flxpath.monkey
flxpoint.monkey
flxrect.monkey
flxsound.monkey
flxsprite.monkey
flxstate.monkey
flxtext.monkey
flxtileblock.monkey
flxtilemap.monkey
flxtimer.monkey
flxu.monkey

README.md

Flixel for Monkey

This is a port of flixel to the Monkey language. The port is translated from flixel v2.55 written by Adam 'Atomic' Saltsman.

Requirements

Monkey v53 or higher

Install

  • For users with git installed:

    • Go to the Monkey modules directory
    • Do git clone git@github.com:devolonter/flixel-monkey.git flixel
    • Optionally. Do git submodule update --init to get bananas
  • For users without git:

Upgrade to new version

  • For users with git installed:

    • git pull
    • Optionally. Do git submodule update to update bananas
  • For users without git:

    • Download the latest version of the library from downloads directory
    • Replace flixel module content by archive data

Naming conventions

  • All-caps case (eg: 'ALLCAPS' ): Constants
  • Pascal case (eg: 'PascalCase' ): Globals, functions, class, methods, properties
  • Camel case (eg: 'camelCase' ): Fields, locals and function parameters

Notes

  • FlxSave currently is not ported
  • Debugger is absent
  • To build Windows Phone applications you must add a reference to Microsoft.Phone to the project

Demo

QuickStart

Import flixel

Function Main()
    New HelloWorld()
    Return 0
End Function

'Main class of the game
Class HelloWorld Extends FlxGame

    Method New()
        Super.New(640, 480, HelloWorldState.ClassObject)    
    End Method

    'Optional
    Method OnContentInit:Void()
        #Rem
        Register here all your assets, to use within application
        Example:
        FlxAssetsManager.AddImage("ball", "graphics/ball.png")

        Now you can load an image in the game this way:
        Local sprite:FlxSprite = New FlxSprite(0, 0, "ball")
        #End
    End Method

End Class

'Main game state 
Class HelloWorldState Extends FlxState

    'necessary to the FlxGame constructor, also used to reset game
    Global ClassObject:FlxClass = new HelloWorldStateClass()

    Method Create:Void()        
        Local helloWorld:FlxText = New FlxText(10, 10, 620, "Hello World!") 
        helloWorld.SetFormat(FlxText.SYSTEM_FONT, 16, FlxG.WHITE, FlxText.ALIGN_CENTER) 
        Add(helloWorld)     
    End Method

    Method Update:Void()
        'put your game logic here
        Super.Update()
        '... or here
    End Method

    'If you do not use FlxG.ResetState, FlxG.ReloadReplay, FlxG.RecordReplay, it is optional to override this method.
    Method GetClass:FlxCalss()
        Return ClassObject
    End Method

End Class

'Monkey currently does not support reflection, so here we emulate necessary functional
Class HelloWorldStateClass Implements FlxClass

    'Creates new instance of an object
    Method CreateInstance:Object()
        Return New HelloWorldState()
    End Method

    'checks that the scanned object belongs to a class
    Method InstanceOf:Bool(object:Object)
        Return (HelloWorldState(object) <> Null)
    End Method

End Class

See more examples in the bananas folder.

Something went wrong with that request. Please try again.