- cross-platform
- modular design
- OOP (object orientated programming)
- function pointers()
- 2d with fast rotate/alpha/scale/filter/blend
- automatic multiple lists for objects. instance can belong to multiple lists
- redimable (its not done with dims anymore) arrays
- arrays can be passed/returned to/from a function
- memory pointers (can access the real location in memory of anything)
- arrays can store arrays. .. and array of arrays!
- shorts,bytes,longs,doubles (more data types)
- can include data into your executable and load directly (readfile("incbin::file.txt"))
- can import c+/c++ libraries into your program, and use them directly with bmax compiling them into the final exe.
- minimum 10k - 20k exe's
- small memory footprint
There is plenty aswell :)
example of OOP
Type vehicle
Field x,y
Field r,g,b
Field name:String
Method update() Abstract
End Type
Type car Extends vehicle
Function Create:vehicle(name:String)
Local c:car = New car
c.name = name
Return vehicle(c)
End Function
Field frontleft_wheel:wheel = New wheel
Field frontright_wheel:wheel = New wheel
Field backleft_wheel:wheel = New wheel
Field backright_wheel:wheel = New wheel
Field enginepower
Method StartEngine()
enginepower = 100
End Method
Method StopEngine()
enginepower = 0
End Method
Method Update()
'do car related movement
End Method
End Type
Type bike Extends vehicle
Function Create:vehicle(name:String)
Local b:bike = New bike
b.name = name
Return vehicle(b)
End Function
Field front_wheel:wheel = New wheel
Field back_wheel:wheel = New wheel
Field gears
Method Update()
'do bike related movement
End Method
End Type
Type wheel
Field ageofwheel
End Type
Local mybike:vehicle = bike.Create("town bike")
Local mycar:vehicle = car.Create("ford")example of function pointers
Local current_tool()
Function tool_update_1()
'draw a rectangle
End Function
Function tool_update_2()
'draw a circle
End Function
current_tool = tool_update_1
Repeat
'call the update function for selected tool
If current_tool <> Null current_tool()
'select various tools
If KeyHit(KEY_1) current_tool = tool_update_1
If KeyHit(KEY_2) current_tool = tool_update_2
Until KeyDown(KEY_ESCAPE)
example of linked lists
Type train_station
Field name:String
End Type
Type train
Field route:TList = CreateList()
method AddStationToRoute(station:train_station)
route.AddLast(station)
end method
End Type
Function CreateStation:train_station(name:String)
Local station:train_station = New train_Station
station.name = name
Return station
End Function
'create some stations
Local station1:train_station = CreateStation("old kent road")
Local station2:train_station = CreateStation("mayfair")
Local station3:train_station = CreateStation("liverpool street")
Local station4:train_station = CreateStation("picadilly")
Local station5:train_station = CreateStation("kings cross")
'create some trains
local train1:train = new train
local train2:train = new train
'design the route for train 1
train1.AddStationToRoute(station1)
train1.AddStationToRoute(station3)
train1.AddStationToRoute(station4)
'design the route for train 2 (circle line)
train1.AddStationToRoute(station1)
train1.AddStationToRoute(station2)
train1.AddStationToRoute(station3)
train1.AddStationToRoute(station4)
train1.AddStationToRoute(station5)
train1.AddStationToRoute(station4)
train1.AddStationToRoute(station3)
train1.AddStationToRoute(station2)