25 |
26 | ' Create two fields that store the width and height of the canvas
27 | Field cw:Float
28 | Field ch:Float
29 |
30 | '------------------------------------------
31 | ' The SpawnShot method will create a new shot. It sets its ID , positions it
32 | ' infront of the canon and set its speed and heading reagrding the angle of the
33 | ' canon.
34 | Method SpawnShot:Int()
35 | ' Create a shot in the middle of the screen
36 | Local shot:ftObject = fE.CreateCircle(5,cw/2, ch/2)
37 |
38 | ' Set the tag of a shot
39 | shot.SetTag(Int(Rnd(1,5)))
40 |
41 | ' Set the speed and the angle of the shot
42 | shotList.AddLast(shot)
43 |
44 | Return 0
45 | End
46 | '------------------------------------------
47 | Method OnCreate:Int()
48 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
49 | SetUpdateRate(60)
50 |
51 | ' Create an instance of the fantomEngine, which was created via the cEngine class
52 | fE = New cEngine
53 |
54 | ' Determine and store the width and height of the canvas
55 | cw = fE.GetCanvasWidth()
56 | ch = fE.GetCanvasHeight()
57 |
58 | ' Output some info
59 | Print ("Press SPACE to release a shot")
60 |
61 | Return 0
62 | End
63 | '------------------------------------------
64 | Method OnUpdate:Int()
65 | ' Determine the delta time and the update factor for the engine
66 | Local d:Float = Float(fE.CalcDeltaTime())/60.0
67 |
68 | ' Update all shots depending on their tag value
69 | For Local obj := Eachin shotList
70 | If obj.GetTag() = 1 Then obj.SetPos(-2,0,True)
71 | If obj.GetTag() = 2 Then obj.SetPos(2,0,True)
72 | If obj.GetTag() = 3 Then obj.SetPos(0,-2,True)
73 | If obj.GetTag() = 4 Then obj.SetPos(0,2,True)
74 | Next
75 |
76 | ' Update all objects of the engine
77 | fE.Update(d)
78 |
79 | ' If the SPACE key was pressed, spwan a new shot
80 | If KeyHit(KEY_SPACE) Then SpawnShot()
81 |
82 | Return 0
83 | End
84 | '------------------------------------------
85 | Method OnRender:Int()
86 | ' Clear the screen
87 | Cls
88 |
89 | ' Render all visible objects of the engine
90 | fE.Render()
91 |
92 | Return 0
93 | End
94 | End
95 |
96 | '***************************************
97 | ' The cEngine class extends the ftEngine class to override the On... methods
98 | Class cEngine Extends ftEngine
99 | ' No On.. callback methods are used in this example
100 | End
101 |
102 | '***************************************
103 | Function Main:Int()
104 | ' Create an instance of the cGame class and store it inside the global var 'g'
105 | _g = New cGame
106 | Return 0
107 | End
108 |
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/char_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/char_01.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/char_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/char_02.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/char_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/char_03.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/char_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/char_04.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/char_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/char_05.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/td_spritesheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/AnimObject/AnimObject.data/td_spritesheet.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/AnimObject/AnimObject.data/td_spritesheet.txt:
--------------------------------------------------------------------------------
1 | td_spritesheet.png
2 | format: RGBA8888
3 | filter: Linear,Linear
4 | repeat: none
5 | TurretBase
6 | rotate: false
7 | xy: 0, 0
8 | size: 128, 128
9 | orig: 128, 128
10 | offset: 0, 0
11 | index: -1
12 | UFOShot
13 | rotate: false
14 | xy: 238, 34
15 | size: 8, 10
16 | orig: 8, 10
17 | offset: 1, 0
18 | index: -1
19 | Gold
20 | rotate: false
21 | xy: 206, 48
22 | size: 32, 32
23 | orig: 32, 32
24 | offset: 0, 0
25 | index: -1
26 | Destroyer
27 | rotate: false
28 | xy: 0, 128
29 | size: 128, 128
30 | orig: 128, 128
31 | offset: 0, 0
32 | index: -1
33 | TurretBullet
34 | rotate: false
35 | xy: 238, 16
36 | size: 18, 18
37 | orig: 18, 18
38 | offset: 55, 23
39 | index: -1
40 | Mine
41 | rotate: false
42 | xy: 160, 74
43 | size: 32, 32
44 | orig: 32, 32
45 | offset: 0, 0
46 | index: -1
47 | EkstraLive
48 | rotate: false
49 | xy: 128, 74
50 | size: 32, 32
51 | orig: 32, 32
52 | offset: 0, 0
53 | index: -1
54 | Silver
55 | rotate: false
56 | xy: 206, 16
57 | size: 32, 32
58 | orig: 32, 32
59 | offset: 0, 0
60 | index: -1
61 | TurretHead
62 | rotate: false
63 | xy: 128, 0
64 | size: 78, 74
65 | orig: 78, 74
66 | offset: 26, 30
67 | index: -1
68 | explosion
69 | rotate: false
70 | xy: 206, 0
71 | size: 48, 16
72 | orig: 48, 16
73 | offset: 0, 0
74 | index: -1
75 |
--------------------------------------------------------------------------------
/examples/Objects/Creation/CopyObject/CopyObject.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #Rem
4 | Script: CopyObject.monkey
5 | Description: Sample script that shows how To copy an Object with most of its parameters at runtime
6 | Author: Michael Hartlef
7 | Version: 1.04
8 | #End
9 |
10 | Import fantomEngine
11 | Global g:game
12 |
13 | '***************************************
14 | Class game Extends App
15 | ' Create a field to store the instance of the engine class, which is an instance
16 | ' of the ftEngine class itself
17 | Field eng:engine
18 |
19 | ' Create two fields that store the width and height of the canvas
20 | Field cw:Float
21 | Field ch:Float
22 |
23 | '------------------------------------------
24 | Method OnCreate:Int()
25 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
26 | SetUpdateRate(60)
27 |
28 | ' Create an instance of the fantomEngine, which was created via the engine class
29 | eng = New engine
30 |
31 | ' Determine and store the width and height of the canvas
32 | cw = eng.GetCanvasWidth()
33 | ch = eng.GetCanvasHeight()
34 |
35 | ' Create the 1st object in the middle of the screen
36 | Local obj1 := eng.CreateBox(20,20, cw/2, ch/2 )
37 |
38 | ' Create a child object slightly in the middle of the screen and assign it to the 1st object
39 | Local childObj1 := eng.CreateBox(10,10, cw/2+40, ch/2+40 )
40 | childObj1.SetParent(obj1)
41 |
42 | ' Copy the 1st object, which creates the 2nd object
43 | Local obj2 := eng.CopyObject(obj1)
44 |
45 | ' Set the speed and angle of the 1st object. The second object will stand still
46 | obj1.SetSpeed(10,Rnd(360))
47 |
48 | ' Let the 2nd object spin and scale it up by a factor of 3
49 | obj2.SetSpin(10)
50 | obj2.SetScale(3)
51 |
52 | ' Let the 1st object wrap around the screen edges.
53 | obj1.SetWrapScreen(True)
54 | Return 0
55 | End
56 | '------------------------------------------
57 | Method OnUpdate:Int()
58 | ' Determine the delta time and the update factor for the engine
59 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
60 |
61 | ' Update all objects of the engine
62 | eng.Update(d)
63 |
64 | Return 0
65 | End
66 | '------------------------------------------
67 | Method OnRender:Int()
68 | ' Clear the screen
69 | Cls
70 |
71 | ' Render all visible objects of the engine
72 | eng.Render()
73 |
74 | Return 0
75 | End
76 | End
77 |
78 | '***************************************
79 | Class engine Extends ftEngine
80 | ' No On.. callback methods are used in this example
81 | End
82 |
83 | '***************************************
84 | Function Main:Int()
85 | g = New game
86 | Return 0
87 | End
88 |
--------------------------------------------------------------------------------
/examples/Objects/Creation/CustomObject/CustomObject.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: ExtendedObject.monkey
5 | Description: Sample script that shows how To extend the Object class
6 | Author: Michael Hartlef
7 | Version: 1.03
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The g variable holds an instance to the game class
17 | Global g:game
18 |
19 |
20 | '***************************************
21 | ' This is the extended ftObject class
22 | Class myObject Extends ftObject
23 | Field mySpinSpeed:Float = -5.0
24 | Field xfactor:Float = 10.0
25 | '------------------------------------------
26 | Method New()
27 | ' In its constructor, set the spin property to turn left
28 | Self.SetSpin(mySpinSpeed)
29 |
30 | ' Deactivate the OnObjectUpdate event call as
31 | ' we handle things inside the classes own Update method
32 | Self.ActivateUpdateEvent(False)
33 | End
34 | '------------------------------------------
35 | Method Update:Void(speed:Float = 1.0)
36 | ' Call the Update method of the base class
37 | Super.Update(speed)
38 |
39 | ' Raise the objects scale factors
40 | Self.SetScale(0.01,True)
41 | End
42 | End
43 |
44 | '***************************************
45 | ' The game class controls the app
46 | Class game Extends App
47 | ' Create a field to store the instance of the engine class, which is an instance
48 | ' of the ftEngine class itself
49 | Field eng:engine
50 |
51 | '------------------------------------------
52 | Method OnCreate:Int()
53 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
54 | SetUpdateRate(60)
55 |
56 | ' Create an instance of the fantomEngine, which was created via the engine class
57 | eng = New engine
58 |
59 | ' Create a new box object on the right side with the base ftObject class
60 | Local obj := eng.CreateBox(20,120,eng.GetCanvasWidth()/4*3, eng.GetCanvasHeight()/2)
61 |
62 | ' Let the object spin by a factor of 10 at each Update call
63 | obj.SetSpin(10)
64 |
65 | ' Set its speed property to 2
66 | obj.SetSpeed(2)
67 |
68 | ' Now create another box object on the left side, but this
69 | ' time create the object within the method call an use the myObject class
70 | Local obj2 := eng.CreateBox(20,120,eng.GetCanvasWidth()/4, eng.GetCanvasHeight()/2, New myObject)
71 |
72 | ' Set its speed to -2
73 | obj2.SetSpeed(-2)
74 |
75 | Return 0
76 | End
77 | '------------------------------------------
78 | Method OnUpdate:Int()
79 | ' Determine the delta time and the update factor for the engine
80 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
81 |
82 | ' Update all objects of the engine
83 | eng.Update(d)
84 |
85 | Return 0
86 | End
87 | '------------------------------------------
88 | Method OnRender:Int()
89 | ' Check if the app is not suspended
90 | If eng.GetPaused() = False Then
91 | ' Clear the screen
92 | Cls
93 |
94 | ' Render all visible objects of the engine
95 | eng.Render()
96 | Endif
97 | Return 0
98 | End
99 | '------------------------------------------
100 | Method OnResume:Int()
101 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
102 | eng.SetPaused(false)
103 | Return 0
104 | End
105 | '------------------------------------------
106 | Method OnSuspend:Int()
107 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
108 | eng.SetPaused(True)
109 | Return 0
110 | End
111 | End
112 |
113 | '***************************************
114 | ' The engine class extends the ftEngine class to override the On... methods
115 | Class engine Extends ftEngine
116 | '------------------------------------------
117 | Method OnObjectUpdate:Int(obj:ftObject)
118 | ' This method is called when an object finishes its update
119 | obj.SetPos(1,0,True)
120 | Return 0
121 | End
122 | End
123 |
124 | '***************************************
125 | Function Main:Int()
126 | ' Create an instance of the game class and store it inside the global var 'g'
127 | g = New game
128 |
129 | Return 0
130 | End
131 |
--------------------------------------------------------------------------------
/examples/Objects/Creation/LoadImage/LoadImage.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/LoadImage/LoadImage.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/LoadImage/LoadImage.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: LoadImage.monkey
5 | 'Description: Same script that shows how to load and a single image
6 | Author: Michael Hartlef
7 | Version: 1.01
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The _g variable holds an instance to the cGame class
17 | Global _g:cGame
18 |
19 | '***************************************
20 | ' The cGame class controls the app
21 | Class cGame Extends App
22 | ' Create a field to store the instance of the cEngine class, which is an instance
23 | ' of the ftEngine class itself
24 | Field fE:cEngine
25 |
26 | 'Create a field for your object
27 | Field myObject:ftObject
28 |
29 | '------------------------------------------
30 | Method OnCreate:Int()
31 | ' Set the update rate of Mojo's OnUpdate events to 60 FPS
32 | SetUpdateRate(60)
33 |
34 | ' Create an instance of the fantomEngine, which was created via the cEngine class
35 | fE = New cEngine
36 |
37 | ' Now load the single image
38 | myObject = fE.CreateImage("cratesmall.png", 320, 240)
39 |
40 | Return 0
41 | End
42 | '------------------------------------------
43 | Method OnUpdate:Int()
44 | If KeyHit( KEY_CLOSE ) Then fE.ExitApp()
45 | ' Determine the delta time and the update factor for the engine
46 | Local timeDelta:Float = Float(fE.CalcDeltaTime())/60.0
47 |
48 | ' Update all objects of the engine
49 | If fE.GetPaused() = False Then
50 | fE.Update(timeDelta)
51 | Endif
52 | Return 0
53 | End
54 | '------------------------------------------
55 | Method OnRender:Int()
56 | ' Check if the engine is not paused
57 | If fE.GetPaused() = False Then
58 | ' Clear the screen
59 | Cls
60 |
61 | ' Render all visible objects of the engine
62 | fE.Render()
63 | Endif
64 | Return 0
65 | End
66 | End
67 |
68 | '***************************************
69 | ' The cEngine class extends the ftEngine class to override the On... methods
70 | Class cEngine Extends ftEngine
71 | '------------------------------------------
72 | Method OnObjectUpdate:Int(obj:ftObject)
73 | ' This method is called when an object finishes its update. You can deactivate the event via ftObject.ActivateUpdateEvent.
74 | obj.SetAngle(1,True)
75 | Return 0
76 | End
77 | End
78 |
79 | '***************************************
80 | Function Main:Int()
81 | ' Create an instance of the cGame class and store it inside the global var 'g'
82 | _g = New cGame
83 |
84 | Return 0
85 | End
86 |
--------------------------------------------------------------------------------
/examples/Objects/Creation/RemoveObject/RemoveObject.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Objects/Creation/RemoveObject/RemoveObject.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Objects/Creation/RemoveObject/RemoveObject.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: RemoveObject.monkey
5 | Description: Sampe script that shows how to remove objects
6 | Author: Michael Hartlef
7 | Version: 1.04
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The g variable holds an instance to the game class
17 | Global g:game
18 |
19 |
20 | '***************************************
21 | ' The game class controls the app
22 | Class game Extends App
23 | ' Create a field to store the instance of the engine class, which is an instance
24 | ' of the ftEngine class itself
25 | Field eng:engine
26 |
27 | Field delCount:Int = 0
28 | Field layerNo:Int =1
29 | Field layer2:ftLayer
30 | Field layer1:ftLayer
31 |
32 | '------------------------------------------
33 | Method SpawnObjects:Void(anz:Int=100)
34 | If layerNo = 1 Then
35 | eng.SetDefaultLayer(layer1)
36 | layerNo = 2
37 | Else
38 | eng.SetDefaultLayer(layer2)
39 | layerNo = 1
40 | Endif
41 | For Local i:=1 To anz
42 | 'Local obj := eng.CreateCircle(10,Rnd(eng.GetCanvasWidth()), Rnd(eng.GetCanvasHeight()))
43 | Local obj := eng.CreateImage("cratesmall.png",Rnd(eng.GetCanvasWidth()), Rnd(eng.GetCanvasHeight()))
44 | For Local i:=1 To 3
45 | 'Local obj2 := eng.CreateCircle(5,Rnd(eng.GetCanvasWidth()), Rnd(eng.GetCanvasHeight()))
46 | Local obj2 := eng.CreateImage("cratesmall.png",Rnd(eng.GetCanvasWidth()), Rnd(eng.GetCanvasHeight()))
47 | obj2.SetParent(obj)
48 | obj2.SetScale(Rnd(0.5)+0.5)
49 | Next
50 | Next
51 | End
52 | '------------------------------------------
53 | Method OnCreate:Int()
54 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
55 | SetUpdateRate(60)
56 |
57 | ' Create an instance of the fantomEngine, which was created via the engine class
58 | eng = New engine
59 |
60 | layer1 = eng.GetDefaultLayer()
61 | layer2 = eng.CreateLayer()
62 |
63 | SpawnObjects()
64 | Return 0
65 | End
66 | '------------------------------------------
67 | Method OnUpdate:Int()
68 | ' Determine the delta time and the update factor for the engine
69 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
70 |
71 | ' Check if the app is not suspended
72 | If eng.GetPaused() = False Then
73 | ' Update all objects of the engine
74 | delCount = 0
75 | eng.Update(d)
76 | SpawnObjects()
77 | Endif
78 | Return 0
79 | End
80 | '------------------------------------------
81 | Method OnRender:Int()
82 | ' Check if the app is not suspended
83 | If eng.GetPaused() = False Then
84 | ' Clear the screen
85 | Cls
86 |
87 | ' Render all visible objects of the engine
88 | eng.Render()
89 | DrawText("objects1="+layer1.GetObjCount(),20,20)
90 | DrawText("objects2="+layer2.GetObjCount(),20,40)
91 | DrawText("FPS="+eng.GetFPS(),20,60)
92 | Endif
93 | Return 0
94 | End
95 | '------------------------------------------
96 | Method OnResume:Int()
97 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
98 | eng.SetPaused(false)
99 | Return 0
100 | End
101 | '------------------------------------------
102 | Method OnSuspend:Int()
103 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
104 | eng.SetPaused(True)
105 | Return 0
106 | End
107 |
108 | End
109 |
110 | '***************************************
111 | ' The engine class extends the ftEngine class to override the On... methods
112 | Class engine Extends ftEngine
113 | '------------------------------------------
114 | Method OnObjectUpdate:Int(obj:ftObject)
115 | ' This method is called when an object finishes its update
116 | g.delCount = g.delCount + 1
117 | If g.delCount < 10001 Then obj.Remove()
118 |
119 | Return 0
120 | End
121 |
122 | End
123 |
124 | '***************************************
125 | Function Main:Int()
126 | ' Create an instance of the game class and store it inside the global var 'g'
127 | g = New game
128 |
129 | Return 0
130 | End
131 |
--------------------------------------------------------------------------------
/examples/Objects/DataStorage/DataStorage.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #Rem
4 | Script: DataStorage.monkey
5 | Description: Sample script that shows how to store any data inside an Object and use it at runtime
6 | Author: Michael Hartlef
7 | Version: 1.03
8 | #End
9 |
10 | Import fantomEngine
11 | Global g:game
12 |
13 |
14 | '***************************************
15 | ' This class will store some user defined data fields for our shot objects.
16 | ' Here it is the x/y speed factors for each bullet
17 | Class shotData
18 | Field xSpeed:Float
19 | Field ySpeed:Float
20 | End
21 |
22 |
23 | '***************************************
24 | Class game Extends App
25 | ' Create a field to store the instance of the engine class, which is an instance
26 | ' of the ftEngine class itself
27 | Field eng:engine
28 |
29 | ' Create a field to store the canon object so we can handle it directly
30 | Field canon:ftObject
31 |
32 | ' Create two fields that store the width and height of the canvas
33 | Field cw:Float
34 | Field ch:Float
35 |
36 | '------------------------------------------
37 | ' The SpawnShot method will create a new shot. It sets its ID , positions it
38 | ' infront of the canon and set its speed and heading reagrding the angle of the
39 | ' canon.
40 | Method SpawnShot:Int()
41 | ' Determine the current angle of the canon
42 | Local curAngle:Float = canon.GetAngle()
43 |
44 | ' Determine the vector that is 50 pixels away infront of the canon
45 | Local pos:Float[] = canon.GetVector(50,curAngle)
46 |
47 | ' Create a shot in the middle of the screen
48 | Local shot:ftObject = eng.CreateCircle(5,pos[0], pos[1])
49 |
50 | ' Create a new shotData object
51 | Local userData := New shotData
52 |
53 | ' store the speed values in the data object
54 | userData.xSpeed = (pos[0] - cw/2) / 10
55 | userData.ySpeed = (pos[1] - ch/2) / 10
56 |
57 | ' Set the data object of the shot object
58 | 'shot.SetDataObj(Object(userData))
59 | shot.SetDataObj(userData)
60 |
61 | ' Set its ID to 222 so we can detect it during the OnObjectUpdate event
62 | shot.SetID(222)
63 | Return 0
64 | End
65 | '------------------------------------------
66 | Method OnCreate:Int()
67 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
68 | SetUpdateRate(60)
69 |
70 | ' Create an instance of the fantomEngine, which was created via the engine class
71 | eng = New engine
72 |
73 | ' Determine and store the width and height of the canvas
74 | cw = eng.GetCanvasWidth()
75 | ch = eng.GetCanvasHeight()
76 |
77 | ' Create the canon in the middle of the screen
78 | canon = eng.CreateBox(20,60, cw/2, ch/2 )
79 |
80 | ' Set the ID of the canon so it won't be detected as a shot later
81 | canon.SetID(111)
82 | Return 0
83 | End
84 | '------------------------------------------
85 | Method OnUpdate:Int()
86 | ' Determine the delta time and the update factor for the engine
87 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
88 |
89 | ' Update all objects of the engine
90 | eng.Update(d)
91 |
92 | ' If the LEFT key was pressed, turn the canon by 2 degrees left
93 | If KeyDown(KEY_LEFT) Then canon.SetAngle(-2,True)
94 |
95 | ' If the RIGHT key was pressed, turn the canon by 2 degrees right
96 | If KeyDown(KEY_RIGHT) Then canon.SetAngle(2,True)
97 |
98 | ' If the SPACE key was pressed, spwan a new shot
99 | If KeyHit(KEY_SPACE) Then SpawnShot()
100 |
101 | Return 0
102 | End
103 | '------------------------------------------
104 | Method OnRender:Int()
105 | ' Clear the screen
106 | Cls
107 |
108 | ' Render all visible objects of the engine
109 | eng.Render()
110 |
111 | Return 0
112 | End
113 | End
114 |
115 | '***************************************
116 | Class engine Extends ftEngine
117 | Method OnObjectUpdate:Int(obj:ftObject)
118 | ' Determine if the object is a shot
119 | If obj.GetID() = 222 Then
120 |
121 | ' Get the data object, which holds the speed factors for the shot.
122 | Local ud:shotData = shotData(obj.GetDataObj())
123 |
124 | 'Set the position relatively via the speed factors
125 | obj.SetPos(ud.xSpeed, ud.ySpeed, True)
126 | Endif
127 | Return 0
128 | End
129 | End
130 |
131 | '***************************************
132 | Function Main:Int()
133 | g = New game
134 | Return 0
135 | End
136 |
--------------------------------------------------------------------------------
/examples/Objects/Hierachy/ParentChild/ParentChild.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: ParentChild.monkey
5 | Description: Sample script to show how to use parent/child relationships.
6 | Author: Michael Hartlef
7 | Version: 1.04
8 | #End
9 |
10 | ' Import the fantomEngine framework which imports mojo itself
11 | Import fantomEngine
12 |
13 | ' The g variable holds an instance to the game class
14 | Global g:game
15 |
16 |
17 | '***************************************
18 | ' The game class controls the app
19 | Class game Extends App
20 | ' Create a field to store the instance of the engine class, which is an instance
21 | ' of the ftEngine class itself
22 | Field eng:engine
23 |
24 | ' Create a field field that hold the parent
25 | Field parent:ftObject = Null
26 |
27 | '------------------------------------------
28 | Method SpawnChild:Void()
29 | ' Create the child, it's a box
30 | Local child := eng.CreateBox(20, 20, eng.GetCanvasWidth()*(Rnd(0.5)+0.25), eng.GetCanvasHeight()*(Rnd(0.5)+0.25))
31 |
32 | ' Connect the child to the parent
33 | child.SetParent(parent)
34 |
35 | ' Set a random color for the child
36 | child.SetColor(Rnd(255), Rnd(255), Rnd(255))
37 | End
38 | '------------------------------------------
39 | Method OnCreate:Int()
40 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
41 | SetUpdateRate(60)
42 |
43 | ' Create an instance of the fantomEngine, which was created via the engine class
44 | eng = New engine
45 |
46 | ' Seed the random number generator
47 | Seed = Millisecs()
48 |
49 | ' Create the parent
50 | parent = eng.CreateBox(40,40,eng.GetCanvasWidth()/2,eng.GetCanvasHeight()/2)
51 |
52 | ' Create the child and set its parent
53 | SpawnChild()
54 | Return 0
55 | End
56 | '------------------------------------------
57 | Method OnUpdate:Int()
58 | ' Determine the delta time and the update factor for the engine
59 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
60 | Local child:ftObject = Null
61 |
62 | ' If the parent has children, get the first child
63 | If parent.GetChildCount()>0 Then
64 | child = parent.GetChild(1)
65 | Endif
66 |
67 | ' Set the parents position accordingly to the mouse coordinates
68 | parent.SetPos(eng.GetTouchX(), eng.GetTouchY())
69 |
70 | ' If there is a child, check for the P-Key and disconnect it from the parent
71 | If child <> Null Then
72 | If KeyHit(KEY_P) Then
73 | If child.GetParent() <> Null Then
74 | child.SetParent(Null)
75 | Endif
76 | Endif
77 | Endif
78 | ' If the N-Key was hit, spawn another child
79 | If KeyHit(KEY_N) Then
80 | SpawnChild()
81 | Endif
82 | ' If the Q-Key was hit, scale the parent upwards
83 | If KeyDown(KEY_Q) Then
84 | parent.SetScale(0.02,True)
85 | Endif
86 | ' If the W-Key was hit, scale the parent downpwards
87 | If KeyDown(KEY_W) Then
88 | parent.SetScale(-0.02,True)
89 | Endif
90 | ' If left mouse button was pressed, rotate the parent
91 | If MouseDown(MOUSE_LEFT)
92 | parent.SetAngle(2,True)
93 | Endif
94 | ' If right mouse button was pressed, rotate the parent
95 | If MouseDown(MOUSE_RIGHT)
96 | parent.SetAngle(-2,True)
97 | Endif
98 | ' Update all objects of the engine
99 | eng.Update(d)
100 | Return 0
101 | End
102 | '------------------------------------------
103 | Method OnRender:Int()
104 | ' Clear the screen
105 | Cls
106 |
107 | ' Render all visible objects of the engine
108 | eng.Render()
109 | Return 0
110 | End
111 | End
112 |
113 | '***************************************
114 | ' The engine class extends the ftEngine class to override the On... methods
115 | Class engine Extends ftEngine
116 | ' No On.. callback methods are used in this example
117 | End
118 |
119 | '***************************************
120 | Function Main:Int()
121 | ' Create an instance of the game class and store it inside the global var 'g'
122 | g = New game
123 |
124 | Return 0
125 | End
126 |
--------------------------------------------------------------------------------
/examples/Objects/Hierachy/SortObjects/SortObjects.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: SortObjects.monkey
5 | Description: Sample script that shows how so sort objects inside a layer
6 | Author: Michael Hartlef
7 | Version: 1.04
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The g variable holds an instance to the game class
17 | Global g:game
18 |
19 |
20 | '***************************************
21 | ' The game class controls the app
22 | Class game Extends App
23 | ' Create a field to store the instance of the engine class, which is an instance
24 | ' of the ftEngine class itself
25 | Field eng:engine
26 |
27 | ' Create a field for a new layer
28 | Field myLayer:ftLayer
29 |
30 | ' Create a field for a player controllable circle object
31 | Field myCircle:ftObject
32 |
33 | '------------------------------------------
34 | Method OnCreate:Int()
35 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
36 | SetUpdateRate(60)
37 |
38 | ' Create an instance of the fantomEngine, which was created via the engine class
39 | eng = New engine
40 |
41 | ' Create the myLayer layer and set it as the default layer for new objects
42 | myLayer = eng.CreateLayer()
43 | eng.SetDefaultLayer(myLayer)
44 |
45 | ' Create a yellow circle that moves with the mouse cursor
46 | myCircle = eng.CreateCircle(30, eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
47 | myCircle.SetColor(255,255,0)
48 |
49 | ' Create a red box that doesn't move
50 | Local myBox := eng.CreateBox(130, 20, eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
51 | myBox.SetColor(255,0,0)
52 |
53 |
54 | Return 0
55 | End
56 | '------------------------------------------
57 | Method OnUpdate:Int()
58 | ' Determine the delta time and the update factor for the engine
59 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
60 |
61 | ' Check if the app is not suspended
62 | If eng.GetPaused() = False Then
63 |
64 | ' Move the circle to the mouse position
65 | myCircle.SetPos(eng.GetTouchX(), eng.GetTouchY())
66 |
67 | ' Update all objects of the engine
68 | eng.Update(d)
69 |
70 | ' Sort all objects in the myLayer layer.
71 | myLayer.SortObjects()
72 |
73 | Endif
74 | Return 0
75 | End
76 | '------------------------------------------
77 | Method OnRender:Int()
78 | ' Check if the app is not suspended
79 | If eng.GetPaused() = False Then
80 | ' Clear the screen
81 | Cls
82 |
83 | ' Render all visible objects of the engine
84 | eng.Render()
85 | Endif
86 | Return 0
87 | End
88 | '------------------------------------------
89 | Method OnResume:Int()
90 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
91 | eng.SetPaused(false)
92 | Return 0
93 | End
94 | '------------------------------------------
95 | Method OnSuspend:Int()
96 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
97 | eng.SetPaused(True)
98 | Return 0
99 | End
100 |
101 | End
102 |
103 | '***************************************
104 | ' The engine class extends the ftEngine class to override the On... methods
105 | Class engine Extends ftEngine
106 | '------------------------------------------
107 | Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject)
108 | ' This method is called when objects are compared during a sort of its layer list
109 |
110 | ' We compare the bottom (yPos+Height/2) of each object, the ones with a smaller result will
111 | ' be sort infront of the other object and so appear behind the over object.
112 | If (obj1.yPos + obj1.GetHeight()/2) < (obj2.yPos + obj2.GetHeight()/2) Then
113 | Return False
114 | Else
115 | Return True
116 | Endif
117 | End
118 | End
119 |
120 | '***************************************
121 | Function Main:Int()
122 | ' Create an instance of the game class and store it inside the global var 'g'
123 | g = New game
124 |
125 | Return 0
126 | End
127 |
--------------------------------------------------------------------------------
/examples/Physics/Box2DIntegration/Box2DIntegration.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/Box2DIntegration/Box2DIntegration.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Physics/JuggleSoccerBall/JuggleSoccerBall.data/ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/JuggleSoccerBall/JuggleSoccerBall.data/ball.png
--------------------------------------------------------------------------------
/examples/Physics/JuggleSoccerBall/JuggleSoccerBall.data/field.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/JuggleSoccerBall/JuggleSoccerBall.data/field.png
--------------------------------------------------------------------------------
/examples/Physics/MouseJoint/MouseJoint.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/MouseJoint/MouseJoint.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Physics/Raycasting/Raycasting.data/ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/Raycasting/Raycasting.data/ball.png
--------------------------------------------------------------------------------
/examples/Physics/Raycasting/Raycasting.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/Raycasting/Raycasting.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Physics/RevoluteJoint/RevoluteJoint.data/cratesmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Physics/RevoluteJoint/RevoluteJoint.data/cratesmall.png
--------------------------------------------------------------------------------
/examples/Scenes/SceneCreation/SceneCreation.data/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Scenes/SceneCreation/SceneCreation.data/font.png
--------------------------------------------------------------------------------
/examples/Sound/Sound.data/happy.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Sound/Sound.data/happy.mp3
--------------------------------------------------------------------------------
/examples/Sound/Sound.data/shoot.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Sound/Sound.data/shoot.wav
--------------------------------------------------------------------------------
/examples/SpriteSheets/SheetAnim/SheetAnim.data/spriteSheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/SpriteSheets/SheetAnim/SheetAnim.data/spriteSheet.png
--------------------------------------------------------------------------------
/examples/SpriteSheets/SheetAnim/SheetAnim.data/spriteSheet.txt:
--------------------------------------------------------------------------------
1 | spriteSheet.png
2 | format: RGBA8888
3 | filter: Linear,Linear
4 | repeat: none
5 | Blinker
6 | rotate: false
7 | xy: 0, 0
8 | size: 128, 32
9 | orig: 128, 32
10 | offset: 0, 0
11 | index: -1
12 | Circle1
13 | rotate: false
14 | xy: 0, 32
15 | size: 32, 32
16 | orig: 32, 32
17 | offset: 1, 0
18 | index: -1
19 | Circle2
20 | rotate: false
21 | xy: 32, 32
22 | size: 32, 32
23 | orig: 32, 32
24 | offset: 1, 0
25 | index: -1
26 | Circle3
27 | rotate: false
28 | xy: 64, 32
29 | size: 32, 32
30 | orig: 32, 32
31 | offset: 1, 0
32 | index: -1
33 | Circle4
34 | rotate: false
35 | xy: 96, 32
36 | size: 32, 32
37 | orig: 32, 32
38 | offset: 1, 0
39 | index: -1
40 | Ship
41 | rotate: false
42 | xy: 0, 64
43 | size: 32, 32
44 | orig: 32, 32
45 | offset: 0, 0
46 | index: -1
47 |
--------------------------------------------------------------------------------
/examples/SpriteSheets/TexturePacker/TexturePacker.data/td_spritesheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/SpriteSheets/TexturePacker/TexturePacker.data/td_spritesheet.png
--------------------------------------------------------------------------------
/examples/SpriteSheets/TexturePacker/TexturePacker.data/td_spritesheet.txt:
--------------------------------------------------------------------------------
1 | td_spritesheet.png
2 | format: RGBA8888
3 | filter: Linear,Linear
4 | repeat: none
5 | TurretBase
6 | rotate: false
7 | xy: 0, 0
8 | size: 128, 128
9 | orig: 128, 128
10 | offset: 0, 0
11 | index: -1
12 | UFOShot
13 | rotate: false
14 | xy: 238, 34
15 | size: 8, 10
16 | orig: 8, 10
17 | offset: 1, 0
18 | index: -1
19 | Gold
20 | rotate: false
21 | xy: 206, 48
22 | size: 32, 32
23 | orig: 32, 32
24 | offset: 0, 0
25 | index: -1
26 | Destroyer
27 | rotate: false
28 | xy: 0, 128
29 | size: 128, 128
30 | orig: 128, 128
31 | offset: 0, 0
32 | index: -1
33 | TurretBullet
34 | rotate: false
35 | xy: 238, 16
36 | size: 18, 18
37 | orig: 18, 18
38 | offset: 55, 23
39 | index: -1
40 | Mine
41 | rotate: false
42 | xy: 160, 74
43 | size: 32, 32
44 | orig: 32, 32
45 | offset: 0, 0
46 | index: -1
47 | EkstraLive
48 | rotate: false
49 | xy: 128, 74
50 | size: 32, 32
51 | orig: 32, 32
52 | offset: 0, 0
53 | index: -1
54 | Silver
55 | rotate: false
56 | xy: 206, 16
57 | size: 32, 32
58 | orig: 32, 32
59 | offset: 0, 0
60 | index: -1
61 | TurretHead
62 | rotate: false
63 | xy: 128, 0
64 | size: 78, 74
65 | orig: 78, 74
66 | offset: 26, 30
67 | index: -1
68 | explosion
69 | rotate: false
70 | xy: 206, 0
71 | size: 48, 16
72 | orig: 48, 16
73 | offset: 0, 0
74 | index: -1
75 |
--------------------------------------------------------------------------------
/examples/SpriteSheets/TexturePacker/TexturePacker.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: TexturePacker.monkey
5 | Description: Example script on how To use packed texture images created by the tool TexturePacker
6 | Author: Michael Hartlef
7 | Version: 1.05
8 | #end
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The g variable holds an instance to the game class
17 | Global g:game
18 |
19 |
20 | '***************************************
21 | ' The game class controls the app
22 | Class game Extends App
23 | ' Create a field to store the instance of the engine class, which is an instance
24 | ' of the ftEngine class itself
25 | Field eng:engine
26 |
27 | '------------------------------------------
28 | Method OnCreate:Int()
29 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
30 | SetUpdateRate(60)
31 |
32 | ' Create an instance of the fantomEngine, which was created via the engine class
33 | eng = New engine
34 |
35 | ' Set the virtual canvas size to 320x480 and the canvas scale mode to letter box
36 | eng.SetCanvasSize(320,480,ftEngine.cmLetterbox)
37 |
38 | ' Load the packed texture atlas
39 | Local tpatlas:Image = LoadImage("td_spritesheet.png")
40 |
41 | ' Load the packed texture atlas via ftSpriteAtlas class
42 | Local tpatlas2:ftSpriteAtlas = New ftSpriteAtlas
43 | tpatlas2.Load("td_spritesheet.png", "td_spritesheet.txt")
44 |
45 | ' Create several objects
46 | Local myObject0:ftObject = eng.CreateBox(eng.GetCanvasWidth(), eng.GetCanvasHeight(), eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
47 | myObject0.SetColor(0,0,155)
48 |
49 | Local myObject1:ftObject = eng.CreateImage(tpatlas, "td_spritesheet.txt", "gold", 0, 0)
50 | Local myObject2:ftObject = eng.CreateImage(tpatlas2.GetImage("gold"), eng.GetCanvasWidth(), 0)
51 | Local myObject3:ftObject = eng.CreateImage(tpatlas2.GetImage("gold"), 0, eng.GetCanvasHeight())
52 | Local myObject4:ftObject = eng.CreateImage(tpatlas, "td_spritesheet.txt", "gold", eng.GetCanvasWidth(), eng.GetCanvasHeight())
53 |
54 | Local myObject5:ftObject = eng.CreateImage(tpatlas, "td_spritesheet.txt", "turretbase", eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
55 | myObject5.SetSpin(1)
56 |
57 | Local myObject5b:ftObject = eng.CreateImage(tpatlas2.GetImage("turretbase"), eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
58 | 'Set the render area of an Object
59 | myObject5b.SetRenderArea(0,0,64,64)
60 | 'Set its color
61 | myObject5b.SetColor(205,50,205)
62 | 'Make it spin automatically
63 | myObject5b.SetSpin(-1)
64 | Return 0
65 | End
66 | '------------------------------------------
67 | Method OnUpdate:Int()
68 | ' Determine the delta time and the update factor for the engine
69 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
70 |
71 | ' Update all objects of the engine
72 | eng.Update(d)
73 | Return 0
74 | End
75 | '------------------------------------------
76 | Method OnRender:Int()
77 | ' Check if the app is not suspended
78 | If eng.GetPaused() = False Then
79 | ' Clear the screen
80 | Cls
81 |
82 | ' Render all visible objects of the engine
83 | eng.Render()
84 | Endif
85 | Return 0
86 | End
87 | '------------------------------------------
88 | Method OnResume:Int()
89 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
90 | eng.SetPaused(false)
91 | Return 0
92 | End
93 | '------------------------------------------
94 | Method OnSuspend:Int()
95 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
96 | eng.SetPaused(True)
97 | Return 0
98 | End
99 |
100 | End
101 |
102 | '***************************************
103 | ' The engine class extends the ftEngine class to override the On... methods
104 | Class engine Extends ftEngine
105 | ' No On.. callback methods are used in this example
106 | End
107 |
108 | '***************************************
109 | Function Main:Int()
110 | g = New game
111 | Return 0
112 | End
113 |
--------------------------------------------------------------------------------
/examples/Text/FontMachine/FontMachine.data/SportsFont_P_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Text/FontMachine/FontMachine.data/SportsFont_P_1.png
--------------------------------------------------------------------------------
/examples/Text/FontMachine/FontMachine.data/SportsFont_P_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Text/FontMachine/FontMachine.data/SportsFont_P_2.png
--------------------------------------------------------------------------------
/examples/Text/MultilineText/MultilineText.data/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Text/MultilineText/MultilineText.data/font.png
--------------------------------------------------------------------------------
/examples/Text/MultilineText/MultilineText.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: MultilineText.monkey
5 | Description: Sample fantomEngine script, that shows how To use multiline text objects
6 | Author: Michael Hartlef
7 | Version: 1.02
8 | #End
9 | #MOJO_AUTO_SUSPEND_ENABLED=True
10 | Import fantomEngine
11 | Global g:game
12 |
13 | '***************************************
14 | Class game Extends App
15 | ' Create a field to store the instance of the engine class, which is an instance
16 | ' of the ftEngine class itself
17 | Field eng:engine
18 |
19 | '------------------------------------------
20 | Method OnCreate:Int()
21 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
22 | SetUpdateRate(60)
23 |
24 | ' Create an instance of the fantomEngine, which was created via the engine class
25 | eng = New engine
26 |
27 | ' Store the width and height of the canvas
28 | Local cw:Int = 1280
29 | Local ch:Int = 900
30 |
31 | ' Set virtual canvas size
32 | eng.SetCanvasSize(cw, ch)
33 |
34 | ' Load a bitmap font
35 | Local font:ftFont = eng.LoadFont("font.txt")
36 |
37 | ' Create to small boxes to define a cross hair
38 | Local b1:=eng.CreateBox(cw,3,cw/2,ch/2)
39 | Local b2:=eng.CreateBox(3,ch,cw/2,ch/2)
40 |
41 | ' Create some multi line text objects
42 | Local multitxt_TL:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taTopLeft",cw/2,ch/2, eng.taTopLeft)
43 | 'Local multitxt_CL:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taCenterLeft",cw/2,ch/2, eng.taCenterLeft)
44 | Local multitxt_BL:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taBottomLeft",cw/2,ch/2, eng.taBottomLeft)
45 |
46 | 'Local multitxt_TR:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taTopRight",cw/2,ch/2, eng.taTopRight)
47 | Local multitxt_CR:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taCenterRight",cw/2,ch/2, eng.taCenterRight)
48 | 'Local multitxt_BR:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taBottomRight",cw/2,ch/2, eng.taBottomRight)
49 |
50 | 'Local multitxt_TC:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taTopCenter",cw/2,ch/2, eng.taTopCenter)
51 | 'Local multitxt_CC:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taCenterCenter",cw/2,ch/2, eng.taCenterCenter)
52 | 'Local multitxt_BT:ftObject = eng.CreateText(font,"Hello World!~nMonkey is awesome~ntextAlignMode = taBottomCenter",cw/2,ch/2, eng.taBottomCenter)
53 | Return 0
54 | End
55 | '------------------------------------------
56 | Method OnUpdate:Int()
57 | ' Determine the delta time and the update factor for the engine
58 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
59 |
60 | ' Update all objects of the engine
61 | eng.Update(d)
62 | Return 0
63 | End
64 | '------------------------------------------
65 | Method OnRender:Int()
66 | ' Clear the screen
67 | Cls 0,0,155
68 |
69 | ' Render all visible objects of the engine
70 | eng.Render()
71 | Return 0
72 | End
73 | '------------------------------------------
74 | Method OnSuspend:Int()
75 | ' Clear the screen
76 | Error("xxx")
77 | Return 0
78 | End
79 | End
80 |
81 | '***************************************
82 | Class engine Extends ftEngine
83 | ' No On.. callback methods are used in this example
84 | End
85 |
86 |
87 | '***************************************
88 | Function Main:Int()
89 | g = New game
90 | Return 0
91 | End
92 |
--------------------------------------------------------------------------------
/examples/TileMaps/DynamicMap/DynamicMap.data/tilesheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/DynamicMap/DynamicMap.data/tilesheet.png
--------------------------------------------------------------------------------
/examples/TileMaps/DynamicMap/DynamicMap.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: DynamicMap.monkey
5 | Description: Example script on how to self build a (dynamic) map.
6 | Author: Michael Hartlef
7 | Version: 1.08
8 | #end
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | Import fantomEngine
14 | Global g:game
15 |
16 |
17 | '***************************************
18 | Class game Extends App
19 | Field eng:engine
20 | Field tileMap:ftObject
21 | Field atlas:Image
22 | '------------------------------------------
23 | Method OnCreate:Int()
24 | Local c:Int
25 |
26 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
27 | SetUpdateRate(60)
28 |
29 | 'Create an instance of the fantomEngine
30 | eng = New engine
31 |
32 | ' Set the canvas size of a usual Android canvas
33 | eng.SetCanvasSize(320,480)
34 |
35 | 'Define the tile size and how many tiles the map will have in each direction
36 | Local tileWidth:Int = 32
37 | Local tileHeight:Int = 32
38 | Local tileCountX:Int = 1000
39 | Local tileCountY:Int = 1000
40 |
41 |
42 | ' Load the sprite sheet that contains the tiles of our map.
43 | atlas = LoadImage("tilesheet.png" )
44 | If atlas = Null Then Print ("atlas = null")
45 |
46 | ' Now create an empty tile map
47 | tileMap = eng.CreateTileMap(atlas, tileWidth, tileHeight, tileCountX , tileCountY, tileWidth/2.0, tileHeight/2.0 )
48 |
49 | ' Next randomly build the map
50 | For Local yt:Int = 1 To tileCountY
51 | For local xt:Int = 1 To tileCountX
52 | tileMap.SetTileID(xt-1, yt-1, Rnd(0,15) )
53 | Next
54 | Next
55 |
56 | ' Now add a text for the console
57 | Print "Use the cursor keys to move the map, and the mouse buttons to delete or randomly set a map tile."
58 | Return 0
59 | End
60 | '------------------------------------------
61 | Method OnUpdate:Int()
62 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
63 | If eng.GetPaused() = False Then
64 |
65 | eng.Update(Float(d))
66 | 'Remove a tile when you click left with the mouse
67 | If MouseHit( MOUSE_LEFT ) Then
68 | tileMap.SetTileIDAt(eng.GetTouchX(),eng.GetTouchY(),-1)
69 | Endif
70 | 'Set a random tile
71 | If MouseHit( MOUSE_RIGHT ) Then
72 | tileMap.SetTileIDAt(eng.GetTouchX(),eng.GetTouchY(),Rnd(0,15))
73 | Endif
74 | 'Move the camera with the cursor keys
75 | If KeyDown(KEY_LEFT) Then eng.SetCamX(-1,True)
76 | If KeyDown(KEY_RIGHT) Then eng.SetCamX(1,True)
77 | If KeyDown(KEY_UP) Then eng.SetCamY(-1,True)
78 | If KeyDown(KEY_DOWN) Then eng.SetCamY(1,True)
79 | Endif
80 | Return 0
81 | End
82 | '------------------------------------------
83 | Method OnRender:Int()
84 | Local x:Int = eng.GetTouchX()
85 | Local y:Int = eng.GetTouchY()
86 | Cls 0,0,50
87 | eng.Render()
88 | 'Print some debugging messages like FPS and the tile ID under the mouse cursor
89 | DrawText("Tile unter mouse at "+x+":"+y+" = "+tileMap.GetTileIDAt(x,y),eng.GetLocalX(20, False),eng.GetLocalY(10, False))
90 | DrawText("FPS:"+eng.GetFPS(),eng.GetLocalX(20, False),eng.GetLocalY(50, False))
91 | Return 0
92 | End
93 | '------------------------------------------
94 | Method OnResume:Int()
95 | eng.SetPaused(False)
96 | Return 0
97 | End
98 | '------------------------------------------
99 | Method OnSuspend:Int()
100 | eng.SetPaused(True)
101 | Return 0
102 | End
103 | End
104 |
105 | '***************************************
106 | Class engine Extends ftEngine
107 | ' No On.. callback methods are used in this example
108 | End
109 |
110 | '***************************************
111 | Function Main:Int()
112 | g = New game
113 | Return 0
114 | End
115 |
--------------------------------------------------------------------------------
/examples/TileMaps/EndlessMap/EndlessMap.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: endlessMap.monkey
5 | Description: Sample script that illustrates how to build an endless map
6 | Author: Michael Hartlef
7 | Version: 1.01
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The _g variable holds an instance to the cGame class
17 | Global _g:cGame
18 |
19 | '***************************************
20 | ' The cTile class extends the ftObject class
21 | Class cTile Extends ftObject
22 | Field xTileOffset:Int
23 | '------------------------------------------
24 | ' In this overwritten Udpqte method, the position of the tile
25 | ' will be updated and wrapped in relation to the mapPivot object.
26 | Method Update:Void(delta:Float=1.0)
27 | Self.SetPosX(Int(_g.mapPivot.GetPosX()+Self.xTileOffset))
28 | If (Self.GetPosX()-Self.GetWidth()/2.0) > _g.fE.GetCanvasWidth()
29 | Self.SetPosX(-_g.fE.GetCanvasWidth() - Self.GetWidth(),True)
30 | Endif
31 | End
32 | End
33 | '***************************************
34 | ' The cGame class controls the app
35 | Class cGame Extends App
36 | ' Create a field to store the instance of the cEngine class, which is an instance
37 | ' of the ftEngine class itself
38 | Field fE:cEngine
39 |
40 | ' We need a filed to store the mapPivot object
41 | Field mapPivot:ftObject
42 | '------------------------------------------
43 | Method OnCreate:Int()
44 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
45 | SetUpdateRate(60)
46 |
47 | ' Create an instance of the fantomEngine, which was created via the cEngine class
48 | fE = New cEngine
49 | ' Set a virtual canvas size
50 | fE.SetCanvasSize(320,240)
51 |
52 | ' Now create some tiles that wil fill the screen.
53 | ' also store the X offset regarding the mapPivot object
54 | For Local y:= 0 To fE.GetCanvasHeight() Step 64
55 | For Local x:= 0 To fE.GetCanvasWidth() Step 64
56 | Local tile:=fE.CreateBox(64,64,x,y,New cTile)
57 | Local col:= Rnd(100,200)
58 | tile.SetColor(col,col,col)
59 | cTile(tile).xTileOffset = x
60 | Next
61 | Next
62 |
63 | ' Create the mapPivot object. You could create it before the tile objects,
64 | ' but because we want to display its position with a child object, it has to be
65 | ' created afterwards.
66 | mapPivot = fE.CreatePivot(0,0)
67 | mapPivot.SetSpeedX(3)
68 |
69 | ' Create a simple circle as a child of the mapPivot object.
70 | ' This will display the position of the MapPivot object.
71 | Local circle := fE.CreateCircle(20,0,0)
72 | circle.SetParent(mapPivot)
73 |
74 | Return 0
75 | End
76 | '------------------------------------------
77 | Method OnUpdate:Int()
78 | ' If the CLOSE key was hit, exit the app ... needed for GLFW and Android I think.
79 | If KeyHit( KEY_CLOSE ) Then fE.ExitApp()
80 |
81 | ' Determine the delta time and the update factor for the engine
82 | Local timeDelta:Float = Float(fE.CalcDeltaTime())/60.0
83 |
84 | ' Update all objects of the engine
85 | If fE.GetPaused() = False Then
86 | fE.Update(timeDelta)
87 | Endif
88 | Return 0
89 | End
90 | '------------------------------------------
91 | Method OnRender:Int()
92 | ' Check if the engine is not paused
93 | If fE.GetPaused() = False Then
94 | ' Clear the screen
95 | Cls 255,0,255
96 |
97 | ' Render all visible objects of the engine
98 | fE.Render()
99 | Endif
100 | Return 0
101 | End
102 | End
103 |
104 | '***************************************
105 | ' The cEngine class extends the ftEngine class to override the On... methods
106 | Class cEngine Extends ftEngine
107 | '------------------------------------------
108 | Method OnObjectUpdate:Int(obj:ftObject)
109 | ' Check if the mapPivot object left the screen and then wrap it back to the other side.
110 | ' Please note, that we don't use the buildin WrapScreen methods as we want to let it wrap
111 | ' outside the canvas.
112 | If obj = _g.mapPivot
113 | If (obj.GetPosX()-32) > Self.GetCanvasWidth()
114 | obj.SetPosX(-Self.GetCanvasWidth() - 64 ,True)
115 | Print ("privotWrap")
116 | Endif
117 | Endif
118 | Return 0
119 | End
120 | End
121 |
122 | '***************************************
123 | Function Main:Int()
124 | ' Create an instance of the cGame class and store it inside the global var 'g'
125 | _g = New cGame
126 |
127 | Return 0
128 | End
129 |
130 |
--------------------------------------------------------------------------------
/examples/TileMaps/Platformer/Platformer.data/platformer.json:
--------------------------------------------------------------------------------
1 | { "height":15,
2 | "layers":[
3 | {
4 | "data":[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
5 | "height":1,
6 | "name":"test",
7 | "opacity":1,
8 | "type":"tilelayer",
9 | "visible":true,
10 | "width":20,
11 | "x":0,
12 | "y":0
13 | }],
14 | "orientation":"orthogonal",
15 | "properties":
16 | {
17 |
18 | },
19 | "tileheight":32,
20 | "tilesets":[
21 | {
22 | "firstgid":1,
23 | "image":"tiles.png",
24 | "imageheight":128,
25 | "imagewidth":128,
26 | "margin":0,
27 | "name":"tiles.png",
28 | "properties":
29 | {
30 |
31 | },
32 | "spacing":0,
33 | "tileheight":32,
34 | "tilewidth":32
35 | }],
36 | "tilewidth":32,
37 | "version":1,
38 | "width":20
39 | }
--------------------------------------------------------------------------------
/examples/TileMaps/Platformer/Platformer.data/tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Platformer/Platformer.data/tiles.png
--------------------------------------------------------------------------------
/examples/TileMaps/Platformer_Physics/Platformer_Physics.data/platformer.json:
--------------------------------------------------------------------------------
1 | { "height":15,
2 | "layers":[
3 | {
4 | "data":[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
5 | "height":1,
6 | "name":"test",
7 | "opacity":1,
8 | "type":"tilelayer",
9 | "visible":true,
10 | "width":20,
11 | "x":0,
12 | "y":0
13 | }],
14 | "orientation":"orthogonal",
15 | "properties":
16 | {
17 |
18 | },
19 | "tileheight":32,
20 | "tilesets":[
21 | {
22 | "firstgid":1,
23 | "image":"tiles.png",
24 | "imageheight":128,
25 | "imagewidth":128,
26 | "margin":0,
27 | "name":"tiles.png",
28 | "properties":
29 | {
30 |
31 | },
32 | "spacing":0,
33 | "tileheight":32,
34 | "tilewidth":32
35 | }],
36 | "tilewidth":32,
37 | "version":1,
38 | "width":20
39 | }
--------------------------------------------------------------------------------
/examples/TileMaps/Platformer_Physics/Platformer_Physics.data/platformer2.json:
--------------------------------------------------------------------------------
1 | { "height":15,
2 | "layers":[
3 | {
4 | "data":[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
5 | "height":1,
6 | "name":"test",
7 | "opacity":1,
8 | "type":"tilelayer",
9 | "visible":true,
10 | "width":20,
11 | "x":0,
12 | "y":0
13 | }],
14 | "orientation":"orthogonal",
15 | "properties":
16 | {
17 |
18 | },
19 | "tileheight":32,
20 | "tilesets":[
21 | {
22 | "firstgid":1,
23 | "image":"tiles.png",
24 | "imageheight":128,
25 | "imagewidth":128,
26 | "margin":0,
27 | "name":"tiles.png",
28 | "properties":
29 | {
30 |
31 | },
32 | "spacing":0,
33 | "tileheight":32,
34 | "tilewidth":32
35 | }],
36 | "tilewidth":32,
37 | "version":1,
38 | "width":20
39 | }
--------------------------------------------------------------------------------
/examples/TileMaps/Platformer_Physics/Platformer_Physics.data/tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Platformer_Physics/Platformer_Physics.data/tiles.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/MultitileSets.data/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/MultitileSets.data/font.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/MultitileSets.data/maps/isometric_64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/MultitileSets.data/maps/isometric_64x64.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/MultitileSets.data/maps/tiles1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/MultitileSets.data/maps/tiles1.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/MultitileSets.data/maps/tiles2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/MultitileSets.data/maps/tiles2.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/Tiled.data/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/Tiled.data/font.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/Tiled.data/maps/sewer_tileset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/Tiled.data/maps/sewer_tileset.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/Tiled.data/maps/tmw_desert_spacing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/Tiled.data/maps/tmw_desert_spacing.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/TiledIsometric.data/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/TiledIsometric.data/font.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/TiledIsometric.data/maps/isometric_grass_and_water.json:
--------------------------------------------------------------------------------
1 | { "height":25,
2 | "layers":[
3 | {
4 | "data":[24, 24, 23, 11, 19, 19, 12, 23, 24, 24, 23, 7, 2, 2, 1, 4, 2, 2, 3, 4, 4, 1, 3, 4, 1, 24, 23, 23, 14, 3, 3, 8, 12, 24, 24, 18, 4, 1, 3, 1, 3, 3, 4, 4, 1, 3, 1, 4, 3, 4, 11, 15, 15, 7, 1, 4, 3, 20, 23, 11, 7, 2, 1, 3, 1, 3, 4, 4, 3, 2, 2, 3, 4, 2, 1, 18, 4, 3, 2, 2, 4, 3, 8, 12, 18, 2, 4, 4, 3, 3, 1, 4, 2, 1, 4, 4, 4, 1, 1, 1, 14, 2, 1, 4, 2, 1, 4, 2, 8, 7, 5, 17, 6, 3, 3, 3, 4, 3, 4, 4, 3, 2, 4, 3, 4, 10, 6, 2, 1, 4, 4, 1, 3, 4, 3, 8, 12, 10, 6, 2, 1, 1, 1, 1, 2, 1, 4, 2, 1, 1, 24, 18, 1, 2, 4, 3, 3, 5, 6, 5, 13, 9, 11, 7, 3, 4, 1, 3, 1, 3, 4, 2, 4, 4, 4, 24, 14, 4, 2, 5, 6, 2, 8, 22, 9, 23, 24, 10, 6, 2, 1, 3, 1, 5, 6, 2, 3, 4, 4, 2, 19, 7, 3, 1, 8, 7, 4, 1, 8, 12, 24, 23, 23, 10, 17, 6, 3, 1, 8, 7, 1, 3, 3, 3, 1, 1, 2, 4, 2, 2, 3, 3, 4, 3, 20, 24, 23, 23, 23, 23, 18, 2, 2, 3, 1, 4, 4, 1, 1, 1, 3, 3, 5, 13, 6, 1, 2, 2, 5, 9, 23, 23, 24, 23, 24, 14, 1, 3, 1, 1, 3, 3, 4, 4, 4, 2, 4, 16, 24, 10, 6, 2, 4, 20, 23, 23, 24, 23, 23, 24, 14, 2, 4, 2, 4, 5, 6, 4, 3, 1, 3, 1, 20, 23, 24, 10, 6, 3, 8, 12, 24, 23, 23, 23, 24, 14, 1, 2, 1, 5, 9, 18, 4, 3, 4, 4, 2, 8, 12, 23, 24, 18, 4, 3, 16, 24, 24, 24, 23, 24, 18, 1, 3, 1, 16, 24, 14, 1, 3, 2, 4, 1, 2, 8, 12, 24, 14, 4, 1, 8, 15, 12, 24, 23, 11, 7, 2, 1, 2, 16, 23, 18, 1, 4, 2, 3, 4, 3, 2, 8, 19, 7, 2, 2, 3, 3, 8, 15, 19, 7, 3, 1, 2, 5, 9, 24, 14, 1, 2, 3, 2, 2, 1, 4, 4, 1, 2, 5, 6, 2, 2, 2, 1, 3, 4, 3, 5, 13, 9, 24, 24, 18, 4, 3, 4, 1, 4, 1, 3, 2, 5, 13, 9, 14, 3, 1, 3, 2, 4, 4, 5, 21, 19, 12, 24, 11, 7, 1, 2, 3, 2, 1, 3, 3, 3, 20, 23, 24, 18, 4, 4, 2, 3, 1, 1, 8, 7, 5, 9, 23, 18, 1, 3, 4, 2, 4, 2, 4, 1, 2, 8, 15, 19, 7, 4, 5, 6, 4, 2, 4, 5, 17, 9, 23, 11, 22, 13, 6, 4, 1, 3, 2, 2, 4, 4, 3, 2, 1, 4, 2, 8, 7, 4, 2, 3, 16, 24, 23, 11, 7, 16, 23, 18, 3, 1, 1, 3, 1, 2, 3, 3, 3, 4, 2, 1, 3, 2, 3, 4, 3, 8, 15, 15, 7, 4, 8, 19, 7, 3, 4, 1, 2, 3, 4, 1, 3, 4, 4, 4, 1, 4, 4, 3, 2, 3, 4, 1, 2, 4, 2, 1, 2, 2, 4, 1, 4, 2, 3, 2, 1, 4, 2, 2, 1, 2, 2, 2, 4, 3, 3, 2, 3, 3, 2, 3, 2, 4, 1, 3, 1, 1, 1, 1, 4, 1, 3, 3, 2, 1, 4, 2, 1, 3, 1, 3, 3, 4, 3, 4, 2, 1, 2, 3, 1, 1],
5 | "height":25,
6 | "name":"Tile Layer 1",
7 | "opacity":1,
8 | "type":"tilelayer",
9 | "visible":true,
10 | "width":25,
11 | "x":0,
12 | "y":0
13 | }],
14 | "orientation":"isometric",
15 | "properties":
16 | {
17 |
18 | },
19 | "tileheight":32,
20 | "tilesets":[
21 | {
22 | "firstgid":1,
23 | "image":"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Applications\/Tiled_090_examples\/isometric_grass_and_water.png",
24 | "imageheight":384,
25 | "imagewidth":256,
26 | "margin":0,
27 | "name":"isometric_grass_and_water",
28 | "properties":
29 | {
30 |
31 | },
32 | "spacing":0,
33 | "tileheight":64,
34 | "tileoffset":
35 | {
36 | "x":0,
37 | "y":16
38 | },
39 | "tilewidth":64
40 | }],
41 | "tilewidth":64,
42 | "version":1,
43 | "width":25
44 | }
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/TiledIsometric.data/maps/isometric_grass_and_water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/TileMaps/Tiled/TiledIsometric.data/maps/isometric_grass_and_water.png
--------------------------------------------------------------------------------
/examples/TileMaps/Tiled/TiledIsometric.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: TiledIsometric.monkey
5 | Description: Example script on how to use isometric tilemaps created by the tool Tiled
6 | Author: Michael Hartlef
7 | Version: 1.01
8 | #end
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | Import fantomEngine
14 |
15 | Global g:game
16 |
17 |
18 | '***************************************
19 | Class game Extends App
20 | Field eng:engine
21 | Field tm:ftObject
22 |
23 | Field layerMap:ftLayer
24 | Field layerGUI:ftLayer
25 | Field txtInfo1:ftObject
26 | Field txtInfo2:ftObject
27 | '------------------------------------------
28 | Method OnCreate:Int()
29 | Local c:Int
30 |
31 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
32 | SetUpdateRate(60)
33 | ' Create an instance of the fantomEngine, which was created via the engine class
34 | eng = New engine
35 |
36 | 'Set the canvas size of a usual Android canvas
37 | 'eng.SetCanvasSize(480,800)
38 | 'eng.SetCanvasSize(1024,768)
39 |
40 | 'Load the tile map created by Tiled
41 | tm = eng.CreateTileMap("maps/isometric_grass_and_water.json", 200, 30 )
42 |
43 |
44 |
45 | 'Set its scale factor
46 | 'tm.SetScale(2)
47 | 'Set the scale mod factor for each tile of the map
48 | 'tm.SetTileSModXY(-0.1,-0.1)
49 |
50 | ' Load a bitmap font
51 | Local font:ftFont = eng.LoadFont("font.txt")
52 |
53 | ' Set and create some layers
54 | layerMap = eng.GetDefaultLayer()
55 | layerGUI = eng.CreateLayer()
56 | ' Set the GUI flag of the GUI layer so it isn't effected by the camera
57 | layerGUI.SetGUI(True)
58 |
59 |
60 | ' Create some info text objects
61 | eng.SetDefaultLayer(layerGUI)
62 | txtInfo1 = eng.CreateText(font,"FPS: 60",10,10, eng.taTopLeft)
63 | txtInfo1.SetTouchMode(ftEngine.tmBound)
64 | txtInfo1.SetName("txtInfo1")
65 |
66 | txtInfo2 = eng.CreateText(font,"0:0=0",eng.GetCanvasWidth()-10,eng.GetCanvasHeight()-10, eng.taBottomRight)
67 | txtInfo2.SetTouchMode(ftEngine.tmBound)
68 | txtInfo2.SetName("txtInfo2")
69 |
70 | Return 0
71 | End
72 | '------------------------------------------
73 | Method OnUpdate:Int()
74 | ' Calculate the current delta time for this frame
75 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
76 |
77 | ' Determine the current touch/mouse coordinates
78 | Local x:Int = eng.GetTouchX()
79 | Local y:Int = eng.GetTouchY()
80 |
81 | ' Check if the engine is paused
82 | If eng.GetPaused() = False Then
83 |
84 | ' Update all objects of the engine
85 | eng.Update(Float(d))
86 |
87 | 'Remove a tile when you click left with the mouse
88 | If MouseHit( MOUSE_LEFT ) Then
89 | ' Do a touchcheck, if object is hit, engine.onObjectTouch is called.
90 | eng.TouchCheck()
91 | ' Remove the tile
92 | tm.SetTileIDAt(x ,y,-1)
93 | Endif
94 |
95 | 'Set a random tile when you do a right mouse click
96 | If MouseHit( MOUSE_RIGHT ) Then
97 | tm.SetTileIDAt(x, y, Rnd(0,15))
98 | Endif
99 |
100 | 'Move the camera with the cursor keys
101 | If KeyDown(KEY_LEFT) Then eng.SetCamX(-5*d,True)
102 | If KeyDown(KEY_RIGHT) Then eng.SetCamX(5*d,True)
103 | If KeyDown(KEY_UP) Then eng.SetCamY(-5*d,True)
104 | If KeyDown(KEY_DOWN) Then eng.SetCamY(5*d,True)
105 |
106 | 'Update the info text objects
107 | txtInfo1.SetText("FPS:"+eng.GetFPS())
108 | txtInfo2.SetText(x+":"+y+" tileID="+tm.GetTileIDAt(x,y))
109 |
110 |
111 | Endif
112 | Return 0
113 | End
114 | '------------------------------------------
115 | Method OnRender:Int()
116 | If eng.GetPaused()=False Then
117 | Cls 100,100,100
118 | eng.Render()
119 | Endif
120 | Return 0
121 | End
122 | '------------------------------------------
123 | Method OnResume:Int()
124 | eng.SetPaused(False)
125 | Return 0
126 | End
127 | '------------------------------------------
128 | Method OnSuspend:Int()
129 | eng.SetPaused(True)
130 | Return 0
131 | End
132 | End
133 |
134 | '***************************************
135 | Class engine Extends ftEngine
136 | '------------------------------------------
137 | ' This method is called when an object was touched.
138 | Method OnObjectTouch:Int(obj:ftObject, touchId:Int)
139 | Return 0
140 | End
141 | End
142 |
143 | '***************************************
144 | Function Main:Int()
145 | g = New game
146 | Return 0
147 | End
148 |
--------------------------------------------------------------------------------
/examples/Timers/Timers.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: Timer.monkey
5 | Description: Sample script to show how to use timer
6 | Author: Michael Hartlef
7 | Version: 1.01
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The _g variable holds an instance to the cGame class
17 | Global _g:cGame
18 |
19 | '***************************************
20 | ' The cGame class controls the app
21 | Class cGame Extends App
22 | ' Create a field to store the instance of the cEngine class, which is an instance
23 | ' of the ftEngine class itself
24 | Field fE:cEngine
25 |
26 | ' Define two constants for timer IDs
27 | Const engineTimer:Int = 1
28 | Const objectTimer:Int = 2
29 |
30 |
31 | '------------------------------------------
32 | Method OnCreate:Int()
33 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
34 | SetUpdateRate(60)
35 |
36 | ' Create an instance of the fantomEngine, which was created via the cEngine class
37 | fE = New cEngine
38 |
39 | ' Create a timer without a connection to an object which creates new circles at every second
40 | fE.CreateTimer(engineTimer, 500, -1)
41 |
42 |
43 | Return 0
44 | End
45 | '------------------------------------------
46 | Method OnUpdate:Int()
47 | ' If the CLOSE key was hit, exit the app ... needed for GLFW and Android I think.
48 | If KeyHit( KEY_CLOSE ) Then fE.ExitApp()
49 |
50 | ' Determine the delta time and the update factor for the engine
51 | Local timeDelta:Float = Float(fE.CalcDeltaTime())/60.0
52 |
53 | ' Update all objects of the engine
54 | If fE.GetPaused() = False Then
55 | fE.Update(timeDelta)
56 | Endif
57 | Return 0
58 | End
59 | '------------------------------------------
60 | Method OnRender:Int()
61 | ' Check if the engine is not paused
62 | If fE.GetPaused() = False Then
63 | ' Clear the screen
64 | Cls 255,0,0
65 |
66 | ' Render all visible objects of the engine
67 | fE.Render()
68 | Endif
69 | Return 0
70 | End
71 | End
72 |
73 | '***************************************
74 | ' The cEngine class extends the ftEngine class to override the On... methods
75 | Class cEngine Extends ftEngine
76 | '------------------------------------------
77 | Method OnObjectTimer:Int(timerId:Int, obj:ftObject)
78 | ' This method is called when an objects' timer was being fired.
79 | If timerId = _g.objectTimer
80 | obj.Remove()
81 | Endif
82 | Return 0
83 | End
84 |
85 | '------------------------------------------
86 | Method OnTimer:Int(timerId:Int)
87 | ' This method is called when an engine timer was being fired.
88 | If timerId = _g.engineTimer
89 | ' Create a simple circle
90 | Local circle := self.CreateCircle(20,Rnd(self.GetCanvasWidth()),Rnd(self.GetCanvasHeight()))
91 |
92 | ' Two ways to create an object bound timer
93 | ' circle.CreateTimer(_g.objectTimer, 1500)
94 | self.CreateObjTimer(circle, _g.objectTimer, 1500)
95 | Endif
96 | Return 0
97 | End
98 | End
99 |
100 | '***************************************
101 | Function Main:Int()
102 | ' Create an instance of the cGame class and store it inside the global var 'g'
103 | _g = New cGame
104 |
105 | Return 0
106 | End
--------------------------------------------------------------------------------
/examples/Transitions/ObjectTransition/ObjectTransition.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: ObjectTransition.monkey
5 | Description: Sample script that shows how to use transitions to transform objects
6 | Author: Michael Hartlef
7 | Version: 1.04
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The _g variable holds an instance to the cGame class
17 | Global _g:cGame
18 |
19 | '***************************************
20 | ' The cGame class controls the app
21 | Class cGame Extends App
22 | ' Create a field to store the instance of the cEngine class, which is an instance
23 | ' of the ftEngine class itself
24 | Field fE:cEngine
25 |
26 | ' Create a field for an object that we can transition
27 | Field myObj:ftObject
28 |
29 | ' Create a field to store the transition
30 | Field trans:ftTrans
31 |
32 | ' Create a constant for the transition ID.
33 | ' This will be used to identify the transition in the ftEngine.OnObjectTransition handler method.
34 | Const transDone:Int = 1
35 |
36 | '------------------------------------------
37 | Method OnCreate:Int()
38 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
39 | SetUpdateRate(60)
40 |
41 | ' Create an instance of the fantomEngine, which was created via the cEngine class
42 | fE = New cEngine
43 |
44 | ' Create a box which represents the path the object will transition on
45 | Local tmpBox := fE.CreateBox(fE.GetCanvasWidth()-40.0,40,fE.GetCanvasWidth()/2,fE.GetCanvasHeight()/2.0)
46 |
47 | ' Create the object we want to transition
48 | myObj = fE.CreateCircle(18, 40, fE.GetCanvasHeight()/2.0)
49 | ' Set its color to Red
50 | myObj.SetColor(255,0,0)
51 | ' Set the objects Tag value which indicates in which direction it is running
52 | myObj.SetTag(1)
53 | ' Now start a transition to the other side of the canvas and store it
54 | trans = myObj.CreateTransPos((fE.GetCanvasWidth()-80) * myObj.GetTag(), 0, 4000 ,True, transDone)
55 | ' Set the equation type of the transition
56 | trans.SetType("Bounce")
57 | ' Set the ease type pf the transition
58 | trans.SetEase("EaseIn")
59 | ' Print a little info message
60 | Print ("Press the key to pause/resume the transition")
61 |
62 | Return 0
63 | End
64 | '------------------------------------------
65 | Method OnUpdate:Int()
66 | ' Determine the delta time and the update factor for the engine
67 | Local d:Float = Float(fE.CalcDeltaTime())/60.0
68 |
69 | ' Update all objects of the engine
70 | If fE.GetPaused() = False Then
71 | ' Check if the P key was hit
72 | If KeyHit(KEY_P) Then
73 | ' If the transition is paused, resume it. Otherwise pause it.
74 | If trans.GetPaused()=True Then
75 | trans.SetPaused(False)
76 | Else
77 | trans.SetPaused(True)
78 | Endif
79 | Endif
80 | fE.Update(d)
81 | Endif
82 | Return 0
83 | End
84 | '------------------------------------------
85 | Method OnRender:Int()
86 | ' Check if the app is not suspended
87 | If fE.GetPaused() = False Then
88 | ' Clear the screen
89 | Cls
90 |
91 | ' Render all visible objects of the engine
92 | fE.Render()
93 | Endif
94 | Return 0
95 | End
96 | '------------------------------------------
97 | Method OnResume:Int()
98 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
99 | fE.SetPaused(false)
100 |
101 | Return 0
102 | End
103 | '------------------------------------------
104 | Method OnSuspend:Int()
105 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
106 | fE.SetPaused(True)
107 |
108 | Return 0
109 | End
110 | End
111 |
112 | '***************************************
113 | ' The cEngine class extends the ftEngine class to override the On... methods
114 | Class cEngine Extends ftEngine
115 | '------------------------------------------
116 | Method OnObjectTransition:Int(transId:Int, obj:ftObject)
117 | ' This method is called when an object finishes its transition
118 | If transId = _g.transDone Then
119 | ' Negate the Tag value of the object
120 | obj.SetTag(obj.GetTag()*-1)
121 | ' Start a new transtion for this object
122 | _g.trans = obj.CreateTransPos((_g.fE.GetCanvasWidth()-80) * obj.GetTag(), 0, 4000 ,True, _g.transDone)
123 | ' Set the equation type of the transition
124 | _g.trans.SetType("Back")
125 | ' Set the ease type pf the transition
126 | _g.trans.SetEase("EaseInOut")
127 | Endif
128 | Return 0
129 | End
130 | End
131 |
132 | '***************************************
133 | Function Main:Int()
134 | ' Create an instance of the cGame class and store it inside the global var 'g'
135 | _g = New cGame
136 |
137 | Return 0
138 | End
139 |
--------------------------------------------------------------------------------
/examples/Transitions/ObjectTransition/ObjectTransitionImage.data/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Transitions/ObjectTransition/ObjectTransitionImage.data/image.png
--------------------------------------------------------------------------------
/examples/Transitions/ObjectTransition/ObjectTransitionImage.monkey:
--------------------------------------------------------------------------------
1 | Strict
2 |
3 | #rem
4 | Script: ObjectTransitionImage.monkey
5 | Description: Sample script that shows how to use transitions to transform image objects
6 | Author: Michael Hartlef
7 | Version: 1.05
8 | #End
9 |
10 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
11 | #MOJO_AUTO_SUSPEND_ENABLED=True
12 |
13 | ' Import the fantomEngine framework which imports mojo itself
14 | Import fantomEngine
15 |
16 | ' The _g variable holds an instance to the cGame class
17 | Global _g:cGame
18 |
19 | '***************************************
20 | ' The cGame class controls the app
21 | Class cGame Extends App
22 | ' Create a field to store the instance of the cEngine class, which is an instance
23 | ' of the ftEngine class itself
24 | Field fE:cEngine
25 |
26 | ' Create a field to store the transition
27 | Field trans:ftTrans
28 |
29 | ' Create a constant for the transition ID.
30 | ' This will be used to identify the transition in the ftEngine.OnObjectTransition handler method.
31 | Const transDone:Int = 1
32 |
33 | '------------------------------------------
34 | Method OnCreate:Int()
35 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
36 | SetUpdateRate(60)
37 |
38 | ' Create an instance of the fantomEngine, which was created via the cEngine class
39 | fE = New cEngine
40 | 'fE.SetCanvasSize(480,320)
41 | ' Create a box object we want to transition
42 | Local tmpBox := fE.CreateBox(128,128,-100,fE.GetCanvasHeight()/4.0)
43 | tmpBox.SetTag(1)
44 |
45 | ' Create the image object we want to transition
46 | Local tmpImage := fE.CreateImage("image.png", -100, (fE.GetCanvasHeight()/4.0)*3)
47 | tmpImage.SetTag(1)
48 | ' Scale the image up to 150%
49 | tmpImage.SetScale(1.5)
50 |
51 | ' Now start a transition to the other side of the canvas and store it
52 | trans = tmpBox.CreateTransPos(fE.GetCanvasWidth()+200, 0, 6000 ,True, transDone)
53 | ' Set the equation type of the transition
54 | trans.SetType("Cubic")
55 | ' Set the ease type pf the transition
56 | trans.SetEase("EaseInOut")
57 |
58 |
59 | trans = tmpImage.CreateTransPos(fE.GetCanvasWidth()+200, 0, 6000 ,True, transDone)
60 | ' Set the equation type of the transition
61 | trans.SetType("Cubic")
62 | ' Set the ease type pf the transition
63 | trans.SetEase("EaseInOut")
64 | ' Print a little info message
65 | 'Print ("Press the
key to pause/resume the transition")
66 |
67 | 'fE.SetPaused(True)
68 |
69 | Return 0
70 | End
71 | '------------------------------------------
72 | Method OnUpdate:Int()
73 | ' Determine the delta time and the update factor for the engine
74 | Local d:Float = Float(fE.CalcDeltaTime())/60.0
75 |
76 | If KeyHit(KEY_P) = True Then
77 | If fE.GetPaused()=True Then
78 | fE.SetPaused(False)
79 | Else
80 | fE.SetPaused(True)
81 | Endif
82 | Endif
83 |
84 | fE.Update(d)
85 |
86 | Return 0
87 | End
88 | '------------------------------------------
89 | Method OnRender:Int()
90 | ' Check if the app is not suspended
91 | If fE.GetPaused() = False Then
92 | ' Clear the screen
93 | Cls
94 |
95 | ' Render all visible objects of the engine
96 | fE.Render()
97 | Endif
98 | Return 0
99 | End
100 | '------------------------------------------
101 | Method OnResume:Int()
102 | ' Set the pause flag of the engine to FALSE so objects, timers and transitions are updated again
103 | fE.SetPaused(false)
104 |
105 | Return 0
106 | End
107 | '------------------------------------------
108 | Method OnSuspend:Int()
109 | ' Set the pause flag of the engine to TRUE so objects, timers and transitions are paused (not updated)
110 | fE.SetPaused(True)
111 |
112 | Return 0
113 | End
114 | End
115 |
116 | '***************************************
117 | ' The cEngine class extends the ftEngine class to override the On... methods
118 | Class cEngine Extends ftEngine
119 | '------------------------------------------
120 | Method OnObjectTransition:Int(transId:Int, obj:ftObject)
121 | ' This method is called when an object finishes its transition
122 | If transId = _g.transDone Then
123 | ' Negate the Tag value of the object
124 | obj.SetTag(obj.GetTag()*-1)
125 | ' Start a new transtion for this object
126 | _g.trans = obj.CreateTransPos((_g.fE.GetCanvasWidth() + 200) * obj.GetTag(), 0, 6000 ,True, _g.transDone)
127 | ' Set the equation type of the transition
128 | _g.trans.SetType("Cubic")
129 | ' Set the ease type pf the transition
130 | _g.trans.SetEase("EaseInOut")
131 | Endif
132 | Return 0
133 | End
134 | End
135 |
136 | '***************************************
137 | Function Main:Int()
138 | ' Create an instance of the cGame class and store it inside the global var 'g'
139 | _g = New cGame
140 |
141 | Return 0
142 | End
143 |
--------------------------------------------------------------------------------
/examples/Waypoints/Waypoints.data/CarSprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MikeHart66/fantomEngine/41dd816c40d6e6bc815e6e36b332d5f759b5bcd7/examples/Waypoints/Waypoints.data/CarSprite.png
--------------------------------------------------------------------------------
/examples/Waypoints/Waypoints.monkey:
--------------------------------------------------------------------------------
1 |
2 | Strict
3 |
4 | #rem
5 | Script: Waypoints.monkey
6 | Description: Example script on how to use waypoints
7 | Author: Michael Hartlef
8 | Version: 1.04
9 | #End
10 |
11 | ' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
12 | #MOJO_AUTO_SUSPEND_ENABLED=True
13 |
14 | ' Import the fantomEngine framework which imports mojo itself
15 | Import fantomEngine
16 |
17 | ' The g variable holds an instance to the game class
18 | Global g:game
19 |
20 | '***************************************
21 | ' The game class controls the app
22 | Class game Extends App
23 | ' Create a field to store the instance of the engine class, which is an instance
24 | ' of the ftEngine class itself
25 | Field eng:engine
26 |
27 | ' Create a field for a waypoint path
28 | Field path:ftPath
29 |
30 | ' Create a path marker, that object that runs along a path
31 | Field mk:ftMarker
32 |
33 | '------------------------------------------
34 | Method OnCreate:Int()
35 | ' Set the update rate of Mojo's OnUpdate to 60 FPS.
36 | SetUpdateRate(60)
37 |
38 | ' Create an instance of the fantomEngine, which was created via the engine class
39 | eng = New engine
40 |
41 | ' Now set the virtual canvas size
42 | eng.SetCanvasSize(800,600)
43 |
44 | ' Now create a path with its origin at the center of the canvas
45 | path = eng.CreatePath(eng.GetCanvasWidth()/2, eng.GetCanvasHeight()/2)
46 |
47 |
48 | ' Create 4 waypoints
49 | path.AddWP( -150,-150, True)
50 | path.AddWP( 150,-150, True)
51 | path.AddWP( 150,150, True)
52 | path.AddWP( -150,150, True)
53 |
54 | ' Create a marker
55 | mk = path.CreateMarker()
56 |
57 | ' Connect a new image object to the marker
58 | mk.ConnectObj(eng.CreateImage("CarSprite.png",0,0))
59 |
60 | ' Let the marker circle around the path
61 | mk.SetMoveMode(path.mmCircle)
62 |
63 | ' Set its interpolation mode to CatMull Rom spline
64 | mk.SetInterpolationMode(path.imCatmull)
65 |
66 | Return 0
67 | End
68 | '------------------------------------------
69 | Method OnUpdate:Int()
70 | ' Determine the delta time and the update factor for the engine
71 | Local d:Float = Float(eng.CalcDeltaTime())/60.0
72 |
73 | ' Update all objects of the engine
74 | eng.Update(d)
75 |
76 | ' Check if the engine is not paused
77 | If eng.GetPaused() = False Then
78 | ' Update all path marker and their connected objects
79 | path.UpdateAllMarker(d*10)
80 |
81 | ' Scale the path when you press the Q or A key
82 | If KeyDown(KEY_Q) Then
83 | path.SetScale(-0.01,-0.01,True)
84 | Endif
85 | If KeyDown(KEY_A) Then
86 | path.SetScale(0.01,0.01,True)
87 | Endif
88 |
89 | ' Move the path when you press the UP/DOWN key
90 | If KeyDown(KEY_UP) Then
91 | path.SetPos(0,-1,True)
92 | Endif
93 | If KeyDown(KEY_DOWN) Then
94 | path.SetPos(0,1,True)
95 | Endif
96 |
97 | ' Turn the path when you press the RIGHT/LEFT key
98 | If KeyDown(KEY_RIGHT) Then
99 | path.SetAngle(0.5,True)
100 | Endif
101 | If KeyDown(KEY_LEFT) Then
102 | path.SetAngle(-0.5,True)
103 | Endif
104 |
105 | Endif
106 | ' End the app when you press the ESCAPE key
107 | If KeyHit(KEY_ESCAPE) Then eng.ExitApp
108 | Return 0
109 | End
110 | '------------------------------------------
111 | Method OnRender:Int()
112 | ' Check if the engine is not paused
113 | If eng.GetPaused() = False Then
114 | ' Clear the screen
115 | Cls
116 |
117 | ' Render the waypoints of the path
118 | SetColor(0,0,255)
119 | path.RenderAllWP()
120 |
121 | ' Render all visible objects of the engine
122 | eng.Render()
123 | Endif
124 | Return 0
125 | End
126 | '------------------------------------------
127 | Method OnResume:Int()
128 | ' Set the state of the app being not suspended
129 | eng.SetPaused(False)
130 | Return 0
131 | End
132 | '------------------------------------------
133 | Method OnSuspend:Int()
134 | ' Set the state of the app being suspended
135 | eng.SetPaused(True)
136 | Return 0
137 | End
138 | End
139 |
140 | '***************************************
141 | ' The engine class extends the ftEngine class to override the On... methods
142 | Class engine Extends ftEngine
143 | '------------------------------------------
144 | Method OnMarkerCircle:Int(marker:ftMarker, obj:ftObject)
145 | Print ("One round is finished")
146 | Return 0
147 | End
148 |
149 |
150 | End
151 |
152 | '***************************************
153 | Function Main:Int()
154 | ' Create an instance of the game class and store it inside the global var 'g'
155 | g = New game
156 |
157 | Return 0
158 | End
159 |
--------------------------------------------------------------------------------
/fantomEngine.monkey:
--------------------------------------------------------------------------------
1 | #rem
2 | 'Title: fantomEngine
3 | 'Description: A 2D game framework for the Monkey programming language
4 |
5 | 'Author: Michael Hartlef
6 | 'Contact: michaelhartlef@gmail.com
7 |
8 | 'Website: http://www.fantomgl.com
9 |
10 | 'Version: 1.58
11 | 'License: MIT
12 | #End
13 |
14 | #Rem
15 | 'header:The module [b]fantomEngine[/b] is a 2D game framework which supplies you with huge set of game object related functionalities.
16 | To use fantomEngine in your game, simply add "Import fantomEngine" at the top of your program.
17 | #End
18 |
19 |
20 | Import mojo
21 | Import brl.pool
22 |
23 | 'If TARGET="html5"
24 | Import "data/ftLoadingBar.png"
25 | Import "data/ftOrientation_changeP.png"
26 | Import "data/ftOrientation_changeL.png"
27 | 'End
28 |
29 | 'Import reflection
30 | '#REFLECTION_FILTER+="|fantomEngine.cftLayer"
31 | '#REFLECTION_FILTER+="|fantomEngine*"
32 |
33 | Import fantomEngine.cftMisc
34 | Import fantomEngine.cftFunctions
35 | Import fantomEngine.cftImageMng
36 | Import fantomEngine.cftObject
37 | Import fantomEngine.cftObjAnimMng
38 | Import fantomEngine.cftLayer
39 | Import fantomEngine.cftEngine
40 | Import fantomEngine.cftSound
41 | Import fantomEngine.cftTimer
42 | Import fantomEngine.cftFont
43 | Import fantomEngine.cftTrans
44 | Import fantomEngine.cftHighscore
45 | Import fantomEngine.cftSwipe
46 | Import fantomEngine.cftWaypoints
47 | Import fantomEngine.cftAStar
48 | Import fantomEngine.cftLocalization
49 | Import fantomEngine.cftKeyMapping
50 | Import fantomEngine.cftTileMap
51 | Import fantomEngine.cftSpriteAtlas
52 | Import fantomEngine.cftRGBA
53 | Import fantomEngine.cftVec2D
54 | Import fantomEngine.cftScene
55 | Import fantomEngine.cftGui
56 |
57 | #If TARGET="DocMonk"
58 | Import fantomEngine.cftBox2D
59 | #End
60 |
61 | Import json
62 |
63 | '-OUTPUTNAME#index.html
64 | '#INCLFILE#docInclude/introduction.txt
65 | '-INCLFILE#docInclude/classes.txt
66 | '-INCLFILE#docInclude/3rdpartytools.txt
67 | '-INCLFILE#docInclude/examples.txt
68 | '-INCLFILE#docInclude/changes.txt
69 | #rem
70 | footer:This fantomEngine framework is released under the MIT license:
71 | [quote]Copyright (c) 2011-2016 Michael Hartlef
72 |
73 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:
74 |
75 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.
76 |
77 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
78 | [/quote]
79 | #end
--------------------------------------------------------------------------------
/fantomEngine_license.txt:
--------------------------------------------------------------------------------
1 | fantomEngine - A 2D game framework module for the Monkey programming language
2 |
3 | Copyright (c) 2011-2016 Michael Hartlef
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
6 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
13 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 |
--------------------------------------------------------------------------------
/monkeydoc/cftFont.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftFont
2 |
3 | The module cftFont hosts several classes which add bitmap font drawing to fantomEngine. Bitmap fonts are important if you need to show text information inside your game fast and easy.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftFont.ftFont
8 |
9 | The class ftFont provides a few methods regarding the definition of a loaded font.
10 |
11 | # Method Height:Int()
12 |
13 | *Description*
14 |
15 | Returns the maximum height of the font.
16 |
17 | Links: [[Height]]
18 |
19 | # Method Length:Int(t:String)
20 |
21 | *Description*
22 |
23 | Returns the length in pixel of the given text string.
24 |
25 | Links: [[Length]]
26 |
27 |
--------------------------------------------------------------------------------
/monkeydoc/cftFunctions.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftFunctions
2 |
3 | The module cftFunctions is a collection of several functions for IOS, ANDROID and HTML5 targets to retrieve some device and browser informations.
4 |
5 | # Function GetBrowserName:String()
6 |
7 | *Description*
8 |
9 | Returns the name of the HTML5 browser.
10 |
11 | *Details*
12 |
13 | Returns valid information on HTML5 only.
14 |
15 | # Function GetBrowserPlatform:String()
16 |
17 | *Description*
18 |
19 | Returns the platform the HTML5 browser is running on.
20 |
21 | *Details*
22 |
23 | Returns valid information on HTML5 only.
24 |
25 | # Function GetBrowserVersion:String()
26 |
27 | *Description*
28 |
29 | Returns the version of the HTML5 browser.
30 |
31 | *Details*
32 |
33 | Returns valid information on HTML5 only.
34 |
35 | # Function GetDeviceName:String()
36 |
37 | *Description*
38 |
39 | Returns the name of the device.
40 |
41 | *Details*
42 |
43 | Returns valid information on Android/iOS only.
44 |
45 | # Function GetHardware:String()
46 |
47 | *Description*
48 |
49 | Returns the hardware of the device.
50 |
51 | *Details*
52 |
53 | Returns valid information on Android/iOS only.
54 |
55 | # Function GetLanguage:String()
56 |
57 | *Description*
58 |
59 | Returns the language of a browser.
60 |
61 | *Details*
62 |
63 | Returns valid information on HTML5 only.
64 |
65 | # Function GetProduct:String()
66 |
67 | *Description*
68 |
69 | Return the product of the device.
70 |
71 | *Details*
72 |
73 | Returns valid information on Android only.
74 |
75 | # Function GetSerial:String()
76 |
77 | *Description*
78 |
79 | Return the serial number of the device.
80 |
81 | *Details*
82 |
83 | Returns valid information on Android/iOS only.
84 |
85 | # Function GetUser:String()
86 |
87 | *Description*
88 |
89 | Returns the name of the device user.
90 |
91 | *Details*
92 |
93 | Returns valid information on Android/iOS only.
94 |
95 | # Function HideConsole:Void()
96 |
97 | *Description*
98 |
99 | Hides the HTML5 console.
100 |
101 | *Details*
102 |
103 | HTML5 only.
104 |
105 | Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
106 |
107 | # Function IsMobileBrowser:Bool()
108 |
109 | *Description*
110 |
111 | Returns TRUE, if your HTML5 runs on a mobile browser.
112 |
113 | *Details*
114 |
115 | Returns valid information on HTML5 only.
116 |
117 | # Function MaximizeCanvas:Void()
118 |
119 | *Description*
120 |
121 | Maximizes the HTML5 canvas.
122 |
123 | *Details*
124 |
125 | HTML5 only.
126 |
127 | Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
128 |
129 | # Function ResizeCanvas:Void(x:Int, y:Int)
130 |
131 | *Description*
132 |
133 | Resizes the HTML5 canvas to the given proportions.
134 |
135 | *Details*
136 |
137 | HTML5 only.
138 |
139 | Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
140 |
141 | # Function ResizeConsole:Void(x:Int, y:Int)
142 |
143 | *Description*
144 |
145 | Resizes the HTML5 console to the given proportions.
146 |
147 | *Details*
148 |
149 | HTML5 only.
150 |
151 | Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
152 |
153 |
--------------------------------------------------------------------------------
/monkeydoc/cftHighscore.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftHighscore
2 |
3 | The module cftHighScore adds an easy to manage local highscore list to your game.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftHighscore.ftHighScoreList
8 |
9 | The class ftHighScoreList offers a complete set of methods for storing and retrieving high-score list entries.
10 |
11 | # Method AddScore:Int(value:Int, n:String="")
12 |
13 | *Description*
14 |
15 | Tries to add a new entry to the list. Returns the new rank if it is in the list. Returns 0 if not.
16 |
17 | Links: [[GetName]], [[GetValue]]
18 |
19 | # Method Clear:Void()
20 |
21 | *Description*
22 |
23 | Clears the complete high-score list.
24 |
25 | # Method Count:Int()
26 |
27 | *Description*
28 |
29 | Get the numbers of entries.
30 |
31 | Links: [[AddScore]], [[LoadFromString]]
32 |
33 | # Method GetName:String(i:Int)
34 |
35 | *Description*
36 |
37 | Get the name of an entry.
38 |
39 | Links: [[GetValue]], [[AddScore]]
40 |
41 | # Method GetValue:Int(i:Int)
42 |
43 | *Description*
44 |
45 | Get the value of an entry.
46 |
47 | Links: [[GetName]], [[AddScore]]
48 |
49 | # Method LoadFromString:Void(hs:String)
50 |
51 | *Description*
52 |
53 | Load a high-score list from a string.
54 |
55 | Links: [[Count]], [[SaveToString]]
56 |
57 | # Method SaveToString:String()
58 |
59 | *Description*
60 |
61 | Save the high-score list to a string.
62 |
63 | Links: [[LoadFromString]]
64 |
65 | # Method SetCount:Void(count:Int = 10)
66 |
67 | *Description*
68 |
69 | Set the number of highscore entries.
70 |
71 | Links: [[Count]]
72 |
73 |
--------------------------------------------------------------------------------
/monkeydoc/cftImageMng.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftImageMng
2 |
3 | The module cftImageMng contains several classes to manage loaded images inside your game.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftImageMng.ftImage
8 |
9 | The ftImage class contains a mojo image and some information about.
10 |
11 | # Method GetFrameCount:Int()
12 |
13 | *Description*
14 |
15 | Returns the frame count of a ftImage.
16 |
17 | # Method GetFrameHeight:Int()
18 |
19 | *Description*
20 |
21 | Returns the frame height of a ftImage.
22 |
23 | # Method GetFrameWidth:Int()
24 |
25 | *Description*
26 |
27 | Returns the frame width of a ftImage.
28 |
29 | # Method GetImage:Image()
30 |
31 | # Method GetPath:String()
32 |
33 | *Description*
34 |
35 | Returns the path (filename) of a ftImage.
36 |
37 | # Method ReLoad:Void()
38 |
39 | *Description*
40 |
41 | Reloads an image.
42 |
43 | # Method Remove:Void(discard:Bool = False)
44 |
45 | *Description*
46 |
47 | Removes an ftImage.
48 |
49 | # Method SetPath:String(filePath:String)
50 |
51 | *Description*
52 |
53 | Sets the path (filename) of a ftImage.
54 |
55 | # Class cftImageMng.ftImageManager
56 |
57 | The ftImageManager class handles all images for fantomEngine.
58 |
59 | # Method GrabImage:ftImage(atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
60 |
61 | *Description*
62 |
63 | Creates an ftImage by grabbing it from a ftImage atlas.
64 |
65 | # Method GrabImage:ftImage(atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
66 |
67 | *Description*
68 |
69 | Creates an ftImage by grabbing it from a Image atlas.
70 |
71 | # Method LoadImage:ftImage(image:Image)
72 |
73 | *Description*
74 |
75 | Creates an ftImage from an image.
76 |
77 | # Method LoadImage:ftImage(path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags)
78 |
79 | *Description*
80 |
81 | Loads an image like mogo.LoadImage.
82 |
83 | # Method LoadImage:ftImage(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags)
84 |
85 | *Description*
86 |
87 | Loads an image like mogo.LoadImage.
88 |
89 | # Method ReLoadAllImages:Void()
90 |
91 | *Description*
92 |
93 | Reload all images.
94 |
95 | # Method RemoveAllImages:Void(discard:Bool = False)
96 |
97 | *Description*
98 |
99 | Removes all images from the image handler.
100 |
101 | # Method RemoveImage:Void(image:Image, discard:Bool = False)
102 |
103 | *Description*
104 |
105 | Removes an image from the image handler by the given Image handle.
106 |
107 | # Method RemoveImage:Void(filepath:String, discard:Bool = False)
108 |
109 | *Description*
110 |
111 | Removes an image from the image handler by the given filename.
112 |
113 |
--------------------------------------------------------------------------------
/monkeydoc/cftLocalization.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftLocalization
2 |
3 | The module *cftLocalization* contains...
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftLocalization.ftLocalization
8 |
9 | The class *ftLocalization* is an object which helps you supporting multiple languages in your app.
10 |
11 | # Method Clear:Void()
12 |
13 | *Description*
14 |
15 | This method clears all the mapping data.
16 |
17 | # Method GetDefaultLanguage:String()
18 |
19 | *Description*
20 |
21 | This method returns the default language.
22 |
23 | Links: [[SetDefaultLanguage]]
24 |
25 | # Method GetString:String(text:String, langStr:String="")
26 |
27 | *Description*
28 |
29 | This method returns the translated string.
30 |
31 | *Details*
32 |
33 | If no langStr is given, it will use the default language.
34 |
35 | Links: [[LoadFromString]], [[SetDefaultLanguage]]
36 |
37 | # Method LoadFromString:Void(locStr:String)
38 |
39 | *Description*
40 |
41 | This method loads the localization class via a string
42 |
43 | *Details*
44 |
45 | The format of the string has to be (key%;%LanguageShortCut1%:%Translation1%;%...):
46 |
47 | Play%;%DE%:%Spielen
48 |
49 | Options%;%DE%:%Optionen
50 |
51 | Help%;%DE%:%Hilfe
52 |
53 | MultiLine%;%DE%:%Dieser Text%LF%erscheint in 2 Zeilen
54 |
55 | Links: [[GetString]], [[SetDefaultLanguage]]
56 |
57 | # Method SetDefaultLanguage:Void(defLang:String ="EN")
58 |
59 | *Description*
60 |
61 | This method sets the default language.
62 |
63 | Links: [[GetString]], [[GetDefaultLanguage]]
64 |
65 |
--------------------------------------------------------------------------------
/monkeydoc/cftMisc.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftMisc
2 |
3 | # Import fantomEngine
4 |
5 | # Function GetPitchRate:Float(halfStep:Float, base:Float=1.0)
6 |
7 | *Description*
8 |
9 | Calculates the pitchrate for the amount of given halfsteps.
10 |
11 | *Details*
12 |
13 | The default base note is 'A4'
14 |
15 |
--------------------------------------------------------------------------------
/monkeydoc/cftObjAnimMng.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftObjAnimMng
2 |
3 | The module cftObjAnimMng contains several classes to manage animated objects inside your game.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftObjAnimMng.ftAnim
8 |
9 | The ftAnim class represents one animation of an object.
10 |
11 | # Method AddFrame:Void(_imgIndex:Int, _frameIndex:Int)
12 |
13 | *Description*
14 |
15 | Adds a frame to an animated object.
16 |
17 | # Method Update:Void(delta:Float = 1.0)
18 |
19 | *Description*
20 |
21 | Updates the animation of an object.
22 |
23 | # Class cftObjAnimMng.ftObjAnimMng
24 |
25 | The ftObjAnimMng class manages the animations of an object.
26 |
27 | # Method AddAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
28 |
29 | *Description*
30 |
31 | Add to an existing animation. Image and frame indexes start at 1.
32 |
33 | # Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
34 |
35 | *Description*
36 |
37 | Creates a new animation. Image and frame indexes start at 1.
38 |
39 | # Method GetCurrAnimCount:Int()
40 |
41 | *Description*
42 |
43 | Get the number of frames from the active animation.
44 |
45 | # Method GetCurrAnimFrame:Float()
46 |
47 | *Description*
48 |
49 | Get the current frame of the active animation.
50 |
51 | # Method GetCurrAnimName:String()
52 |
53 | *Description*
54 |
55 | Get the animation name.
56 |
57 | # Method GetCurrAnimTime:Float()
58 |
59 | *Description*
60 |
61 | Get the animation frame time.
62 |
63 | # Method RemoveAll:Void()
64 |
65 | *Description*
66 |
67 | Remove all animations.
68 |
69 | # Method SetActiveAnim:Void(animName:String)
70 |
71 | *Description*
72 |
73 | Set the current active anim
74 |
75 | # Method SetCurrAnimFrame:Void(frame:Float)
76 |
77 | *Description*
78 |
79 | Set the frame of the current animation. The frame number starts with 1.
80 |
81 | # Method SetCurrAnimRepeatCount:Void(repeatCount:Int = -1)
82 |
83 | *Description*
84 |
85 | Set the repeat count of the current animation.
86 |
87 | *Details*
88 |
89 | The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself.
90 |
91 | # Method SetCurrAnimTime:Void(time:Float = 10.0)
92 |
93 | *Description*
94 |
95 | Set the factor for the frame time of the current animation.
96 |
97 | *Details*
98 |
99 | The default value is 10.0. The higher the value is, the longer a frame is displayed.
100 |
101 | # Method UpdateCurrAnim:Void(delta:Float = 1.0)
102 |
103 |
--------------------------------------------------------------------------------
/monkeydoc/cftRGBA.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftRGBA
2 |
3 | The cftRGBA module provides a RGBA color class.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftRGBA.ftRGBA
8 |
9 | # Method Add:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
10 |
11 | # Method Add:Void(color:ftRGBA)
12 |
13 | # Method Copy:ftRGBA()
14 |
15 | # Method Inverse:Void(inklAlpha:Bool = False)
16 |
17 | # Method Multiply:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
18 |
19 | # Method Multiply:Void(color:ftRGBA)
20 |
21 | # Method New:none(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
22 |
23 | # Method Set:Void(color:ftRGBA)
24 |
25 | # Method Set:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
26 |
27 | # Method Sub:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
28 |
29 | # Method Sub:Void(color:ftRGBA)
30 |
31 |
--------------------------------------------------------------------------------
/monkeydoc/cftScene.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftScene
2 |
3 | The class *ftScene* groups assigned layers and lets you manage them in a combined way. Layers can be connected to several scenes at one time.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftScene.ftScene
8 |
9 | # Method AddLayer:Void(layer:ftLayer)
10 |
11 | *Description*
12 |
13 | Add a layer to a scene.
14 |
15 | Links: [[RemoveLayer]]
16 |
17 | # Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0)
18 |
19 | *Description*
20 |
21 | Create an alpha transition for the scene.
22 |
23 | *Details*
24 |
25 | The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
26 |
27 | Links: [[CreateTransPos]]
28 |
29 | # Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
30 |
31 | *Description*
32 |
33 | Create an position transition for the scene.
34 |
35 | *Details*
36 |
37 | The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
38 |
39 | Links: [[CreateTransAlpha]]
40 |
41 | # Method GetActive:Bool()
42 |
43 | *Description*
44 |
45 | Returns the active flag of the scene.
46 |
47 | Links: [[SetActive]]
48 |
49 | # Method GetVisible:Bool()
50 |
51 | *Description*
52 |
53 | Returns the visible flag of the scene.
54 |
55 | Links: [[SetVisible]]
56 |
57 | # Method Remove:Void()
58 |
59 | *Description*
60 |
61 | Remove the scene from the engine.
62 |
63 | # Method RemoveLayer:Void(layer:ftLayer)
64 |
65 | *Description*
66 |
67 | Remove a layer from a scene.
68 |
69 | Links: [[AddLayer]]
70 |
71 | # Method SetActive:Void(activeFlag:Bool)
72 |
73 | *Description*
74 |
75 | Set the active flag of the scenes layers.
76 |
77 | Links: [[GetActive]]
78 |
79 | # Method SetAlpha:Void(newAlpha:Float, relative:Bool = False)
80 |
81 | *Description*
82 |
83 | Set the alpha value of each layer in the scene.
84 |
85 | Links: [[SetPos]]
86 |
87 | # Method SetPos:Void(x:Float, y:Float, relative:Bool = False)
88 |
89 | *Description*
90 |
91 | Set the position of each layer in the scene.
92 |
93 | Links: [[SetAlpha]]
94 |
95 | # Method SetVisible:Void(visibleFlag:Bool)
96 |
97 | *Description*
98 |
99 | Set the visible flag of the scenes layers.
100 |
101 | Links: [[GetVisible]]
102 |
103 |
--------------------------------------------------------------------------------
/monkeydoc/cftSound.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftSound
2 |
3 | # Import fantomEngine
4 |
5 | # Class cftSound.ftSound
6 |
7 | The class *ftSound* is an object to play sounds easily.
8 |
9 | # Method GetFreeSoundChannel:Int()
10 |
11 | *Description*
12 |
13 | Returns a free sound channel index.
14 |
15 | # Method GetPan:Float()
16 |
17 | *Description*
18 |
19 | Returns the pan value of a sound.
20 |
21 | Links: [[SetPan]]
22 |
23 | # Method GetPaused:Bool()
24 |
25 | *Description*
26 |
27 | Returns the flag of a sound.
28 |
29 | Links: [[SetPaused]]
30 |
31 | # Method GetPitchRate:Float()
32 |
33 | *Description*
34 |
35 | Returns the pitch rate of a sound.
36 |
37 | Links: [[SetPitchRate]]
38 |
39 | # Method GetVolume:Float()
40 |
41 | *Description*
42 |
43 | Returns the volume of a sound. Ranges from 0.0 to 1.0.
44 |
45 | Links: [[SetVolume]]
46 |
47 | # Method Play:Int(c:Int = -1)
48 |
49 | *Description*
50 |
51 | Plays a sound. If no channel is provided, fantomEngine will determine the channel automatically.
52 |
53 | Links: [[Stop]]
54 |
55 | # Method SetPan:Void(channelPan:Float = 0.0)
56 |
57 | *Description*
58 |
59 | Set the pan value of a sound. Ranges from -1.0 to 1.0.
60 |
61 | *Details*
62 |
63 | A value of -1.0 is on the left side, a value of 1.0 represents the right side.
64 |
65 | Links: [[GetPan]]
66 |
67 | # Method SetPaused:Void(pauseFlag:Bool)
68 |
69 | *Description*
70 |
71 | Pause/resume a sound or a music.
72 |
73 | Links: [[GetPaused]]
74 |
75 | # Method SetPitchRate:Void(channelRate:Float = 1.0)
76 |
77 | *Description*
78 |
79 | Set the rate of a sound.
80 |
81 | *Details*
82 |
83 | The default base note (1.0) is 'A4'. You can use the GetPitchRate("C3") function to determine the rate from a given note.
84 |
85 | Links: [[GetPitchRate]]
86 |
87 | # Method SetVolume:Void(vol:Float = 1.0)
88 |
89 | *Description*
90 |
91 | Set the volume of a sound. Ranges from 0.0 to 1.0.
92 |
93 | Links: [[GetVolume]]
94 |
95 | # Method Stop:Void(c:Int=-1)
96 |
97 | *Description*
98 |
99 | Stop playing the sound. If a channel is given, it will stop that specific sound channel.
100 |
101 | Links: [[Play]]
102 |
103 |
--------------------------------------------------------------------------------
/monkeydoc/cftSpriteAtlas.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftSpriteAtlas
2 |
3 | The class *ftSpriteAtlas* manages spritesheets inside the fantomEngine. It reduces the call to the device storage by imprting all relevant data into memory.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftSpriteAtlas.ftSpriteAtlas
8 |
9 | # Method GetAngleOffset:Float(imageName:String)
10 |
11 | *Description*
12 |
13 | Returns the angle offset of an image.
14 |
15 | # Method GetHeight:Int(imageName:String)
16 |
17 | *Description*
18 |
19 | Returns the height of an image.
20 |
21 | # Method GetImage:Image(imageName:String)
22 |
23 | *Description*
24 |
25 | Returns the image with the given name.
26 |
27 | # Method GetImageCount:Int()
28 |
29 | *Description*
30 |
31 | Returns the number of images in the sprite atlas.
32 |
33 | # Method GetImageHeight:Float(imageName:String)
34 |
35 | *Description*
36 |
37 | Returns the height of the subimage with the given name.
38 |
39 | # Method GetImageWidth:Float(imageName:String)
40 |
41 | *Description*
42 |
43 | Returns the width of the subimage with the given name.
44 |
45 | # Method GetRotated:Bool(imageName:String)
46 |
47 | *Description*
48 |
49 | Returns TRUE if the image with the given name is rotated inside the sprite atlas.
50 |
51 | # Method GetWidth:Int(imageName:String)
52 |
53 | *Description*
54 |
55 | Returns the width of an image.
56 |
57 | # Method Load:Void(imgName:String, dataName:String)
58 |
59 | *Description*
60 |
61 | Loads a sprite atlas from the given image and data file name.
62 |
63 | # Method Remove:Void(discard:Bool = False)
64 |
65 | *Description*
66 |
67 | Remove a sprite atlas. Set discard to TRUE if you want the corresponding images to be discarded.
68 |
69 |
--------------------------------------------------------------------------------
/monkeydoc/cftTimer.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftTimer
2 |
3 | The class *ftTimer* handles ftEngine and ftObject timer objects.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftTimer.ftTimer
8 |
9 | # Method GetPaused:Bool()
10 |
11 | *Description*
12 |
13 | Returns TRUE if a transition is paused.
14 |
15 | Links: [[SetPaused]]
16 |
17 | # Method RemoveTimer:Void()
18 |
19 | *Description*
20 |
21 | With this method removes the timer.
22 |
23 | # Method SetPaused:Void(pauseFlag:Bool = True)
24 |
25 | *Description*
26 |
27 | With this method you can pause and resume the timer.
28 |
29 | Links: [[GetPaused]], [[Update]]
30 |
31 |
--------------------------------------------------------------------------------
/monkeydoc/cftTrans.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftTrans
2 |
3 | The class *ftTrans* controls the way an object or layer does a transition. Starting with version 1.49, it utilizes the tween class from the
4 |
5 | 'monkey sample script in bananas/skn3/tweening/tween.monkey
6 |
7 | # Import cftTween
8 |
9 | # Import fantomEngine
10 |
11 | # Class cftTrans.ftTrans
12 |
13 | # Method GetPaused:Bool()
14 |
15 | *Description*
16 |
17 | Returns TRUE if a transition is paused.
18 |
19 | Links: [[SetPaused]]
20 |
21 | # Method SetEase:none(easeType:String="EaseIn")
22 |
23 | *Description*
24 |
25 | Sets the ease type of a transition.
26 |
27 | *Details*
28 |
29 | This command sets the ease type of a transition. The ease type can be:
30 |
31 |
- EaseIn
32 |
33 |
- EaseOut
34 |
35 |
- EaseInOut
36 |
37 | Links: [[SetType]]
38 |
39 | # Method SetPaused:Void(pauseFlag:Bool = True)
40 |
41 | *Description*
42 |
43 | With this method you can pause and resume the transition.
44 |
45 | Links: [[GetPaused]]
46 |
47 | # Method SetType:none(equationType:String="Linear")
48 |
49 | *Description*
50 |
51 | Sets the equation type of a transition.
52 |
53 | *Details*
54 |
55 | This command sets the equation type of a transition. The equation type can be:
56 |
57 | - Linear
58 |
59 |
- Back
60 |
61 |
- Bounce
62 |
63 |
- Circ
64 |
65 |
- Cubic
66 |
67 |
- Elastic
68 |
69 |
- Expo
70 |
71 |
- Quad
72 |
73 |
- Quart
74 |
75 |
- Quint
76 |
77 |
- Sine
78 |
79 | Links: [[SetEase]]
80 |
81 |
--------------------------------------------------------------------------------
/monkeydoc/cftVec2D.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module cftVec2D
2 |
3 | The cftVec2D module provides a 2D vector class.
4 |
5 | # Import fantomEngine
6 |
7 | # Class cftVec2D.ftVec2D
8 |
9 | # Method Add:Void(vector:ftVec2D)
10 |
11 | # Method Add:Void(addX:Float, addY:Float)
12 |
13 | # Method Angle:Float(vector:ftVec2D)
14 |
15 | # Method Angle:Float(xPos:Float, yPos:Float)
16 |
17 | # Method Angle:Float()
18 |
19 | # Method Copy:ftVec2D()
20 |
21 | # Method Dot:Float(xPos:Float, yPos:Float)
22 |
23 | # Method Dot:Float(vector:ftVec2D)
24 |
25 | # Method Equals:Bool(vector:ftVec2D)
26 |
27 | # Method Inverse:Void()
28 |
29 | # Method InverseX:Void()
30 |
31 | # Method InverseY:Void()
32 |
33 | # Method Length:Float(vector:ftVec2D)
34 |
35 | # Method Length:Float(xPos:Float, yPos:Float)
36 |
37 | # Method Length:Float()
38 |
39 | # Method Mul:Void(scalar:Float)
40 |
41 | # Method New:none(xp:Float, yp:Float)
42 |
43 | # Method Normalize:Void()
44 |
45 | # Method Perp:Void()
46 |
47 | # Method Set:Void(setX:Float, setY:Float)
48 |
49 | # Method Set:Void(vector:ftVec2D)
50 |
51 | # Method Sub:Void(vector:ftVec2D)
52 |
53 | # Method Sub:Void(subX:Float, subY:Float)
54 |
55 | # Field x:Float
56 |
57 | # Field y:Float
58 |
59 |
--------------------------------------------------------------------------------
/monkeydoc/fantomEngine.monkeydoc:
--------------------------------------------------------------------------------
1 | # Module fantomEngine
2 |
3 | The module *fantomEngine* is a 2D game framework which supplies you with huge set of game object related functionalities.
4 |
5 | To use fantomEngine in your game, simply add "Import fantomEngine" at the top of your program.
6 |
7 | Introduction
8 | fantomEngine is a 2D game framework (module) for Monkey X that was created to give game developers more time to work on the actual game play than on setting up render routines, update process chains and stuff like that.
9 |
10 | With fantomEngine you will write only fractions of the code you did before.
11 | Website, bug reports and forum support
The most current version of fantomEngine is now hosted at www.fantomgl.com as Google doesn't let someone create new downloads anymore. You can post issues/bug reports at the new support forum.
12 | The forum is also a good place to ask your questions about how to use fantomEngine or make suggestions about needed features.
13 | Features
fantomEngine currently supports the following features:
14 | - Various objects like images, tile maps, graphic primitives, sounds, collision zones and layers.
15 |
- Automatic processes to create, update and render objects.
16 |
- Callback methods which are called during the handling of an object, layer, timer and transitions.
17 |
- Layer transitions with callback methods.
18 |
- Object transitions for position, rotation, scaling and alpha values with callback methods.
19 |
- Several equation and ease types for object and layer transitions.
20 |
- Object timers with callback methods.
21 |
- Different collision methods with callback methods.
22 |
- Touch input handling with callback methods.
23 |
- Organize your objects in layers.
24 |
- Automatic content scaling via providing a virtual canvas setup.
25 |
- Simple high-score list loading, saving and updating.
26 |
- Simple sound loading which handles the proper file extension depending on the chosen platform.
27 |
- Support for bitmap font text objects which load EzGUI font descriptions.
28 |
- Build-in frames per second calculator.
29 |
- Extensive handling methods for the engine's objects.
30 |
- Simple camera support which you can move around to render parts of your scenery.
31 |
- Support for texture maps (atlas) created by the tool TexturePacker.
32 |
- Support for tile maps created by the tool Tiled.
33 |
- Engine time scaling supporting object updates, timers and transitions.
34 |
- Automatic swipe gesture detection with event method.
35 |
- Path/Waypoint handling. Let your objects follow them.
36 |
- A* pathfinding und user definable grids of nodes. It doesn't have to be a grid of squares!
37 |
- Easy integration of Box2D powered physics including ray casting. Physics definition created by the tool PhysicsEditor are supported too.
38 |
- Localize your game easily with easy support of multiple languages.
39 |
- Support different key maps for different controllers or user definitions.
40 |
- Embedded objects inside a Tiled map will be stored and are accessable.
41 |
- Easy scene/room management.
42 |
- Objects can be composed of several single images.
43 |
- Automatic object pooling.
44 |
- Custom GUI elements
45 | # Import brl.pool
46 |
47 | # Import fantomEngine.cftAStar
48 |
49 | # Import fantomEngine.cftBox2D
50 |
51 | # Import fantomEngine.cftEngine
52 |
53 | # Import fantomEngine.cftFont
54 |
55 | # Import fantomEngine.cftFunctions
56 |
57 | # Import fantomEngine.cftGui
58 |
59 | # Import fantomEngine.cftHighscore
60 |
61 | # Import fantomEngine.cftImageMng
62 |
63 | # Import fantomEngine.cftKeyMapping
64 |
65 | # Import fantomEngine.cftLayer
66 |
67 | # Import fantomEngine.cftLocalization
68 |
69 | # Import fantomEngine.cftMisc
70 |
71 | # Import fantomEngine.cftObjAnimMng
72 |
73 | # Import fantomEngine.cftObject
74 |
75 | # Import fantomEngine.cftRGBA
76 |
77 | # Import fantomEngine.cftScene
78 |
79 | # Import fantomEngine.cftSound
80 |
81 | # Import fantomEngine.cftSpriteAtlas
82 |
83 | # Import fantomEngine.cftSwipe
84 |
85 | # Import fantomEngine.cftTileMap
86 |
87 | # Import fantomEngine.cftTimer
88 |
89 | # Import fantomEngine.cftTrans
90 |
91 | # Import fantomEngine.cftVec2D
92 |
93 | # Import fantomEngine.cftWaypoints
94 |
95 | # Import json
96 |
97 | # Import mojo
98 |
99 |
--------------------------------------------------------------------------------
/native/fantomengine.android.java:
--------------------------------------------------------------------------------
1 | import android.os.Build;
2 |
3 | class fantomengine
4 | {
5 | static String DeviceName()
6 | {
7 | return android.os.Build.MODEL;
8 | }
9 |
10 | static String Hardware()
11 | {
12 | return android.os.Build.HARDWARE;
13 | }
14 |
15 | static String User()
16 | {
17 | return android.os.Build.USER;
18 | }
19 |
20 | static String Product()
21 | {
22 | return android.os.Build.PRODUCT;
23 | }
24 |
25 | static String Serial()
26 | {
27 | return android.os.Build.SERIAL;
28 | }
29 |
30 | static String GetBrowserName()
31 | {
32 | return "---";
33 | }
34 |
35 | static String GetBrowserVersion()
36 | {
37 | return "---";
38 | }
39 |
40 | static String GetBrowserPlatform()
41 | {
42 | return "---";
43 | }
44 | }
--------------------------------------------------------------------------------
/native/fantomengine.ios.cpp:
--------------------------------------------------------------------------------
1 | class fantomengine
2 | {
3 | public:
4 |
5 | static String DeviceName()
6 | {
7 | NSString * localizedModel = [[UIDevice currentDevice] localizedModel];
8 | return [localizedModel UTF8String];
9 | }
10 | static String Hardware()
11 | {
12 | NSString *model = [[UIDevice currentDevice] model];
13 | return [model UTF8String];
14 | }
15 |
16 | static String User()
17 | {
18 | NSString * name = [[UIDevice currentDevice] name];
19 | return [name UTF8String];
20 | }
21 |
22 | static String Product()
23 | {
24 | return '-' ;
25 | }
26 |
27 | static String Serial()
28 | {
29 | NSString *uniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
30 | return [uniqueIdentifier UTF8String];
31 | }
32 |
33 | static String GetBrowserName()
34 | {
35 | return '-' ;
36 | }
37 |
38 | static String GetBrowserVersion()
39 | {
40 | return '-' ;
41 | }
42 |
43 | static String GetBrowserPlatform()
44 | {
45 | return '-' ;
46 | }
47 |
48 | };
49 |
--------------------------------------------------------------------------------