All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.BasicGosu.src.main.gosu.examples.Programs.gsp Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
//
// Gosu has Program files.  Basically, a program lives in a .gsp file and doesn't require 
// the overhead of a normal Class file (a .gs file).
//
// You can script anything you like a program.  You can use any mix of statements, functions, 
// classes, etc.
//

var hi = new Message( "hi" )
printMessage( hi )

function printMessage( m: Message ) {
  print( m.MessageWithTimeStamp )
}

class Message {
  var _text: String
  
  construct( text: String ) {
    _text = text
  }
  
  property get MessageWithTimeStamp(): String {
    return _text + " : " + Date.Today 
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy