This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
flxpoint.monkey
103 lines (90 loc) · 3 KB
/
flxpoint.monkey
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#rem
header:This module contains the FlxPoint class.
[b]IMPORTANT![/b] When porting the library were excluded following original Flixel library FlxPoint class methods:
[code]copyFromFlash, copyToFlash[/code]
#end
Strict
#Rem
summary:Stores a 2D floating point coordinate.
#End
Class FlxPoint
'summary:The X-coordinate of the point in space.
Field x:Float
'summary:The Y-coordinate of the point in space.
Field y:Float
#Rem
summary:Instantiate a new point object.
Params:
[list]
[*]x: The X-coordinate of the point in space.
[*]y: The Y-coordinate of the point in space.
[/list]
#End
Method New(x:Float = 0, y:Float = 0)
Make(x, y)
End Method
#Rem
summary:Instantiate a new point object.
Params:
[list]
[*]x: The X-coordinate of the point in space.
[*]y: The Y-coordinate of the point in space.
[/list]
#End
Method Make:FlxPoint(x:Float = 0, y:Float = 0)
Self.x = x
Self.y = y
Return Self
End Method
#Rem
summary:Helper function, just copies the values from the specified point.
Return a reference to itself.
[list]
[*]point: Any [a flxpoint.monkey.html]FlxPoint[/a]
[/list]
#End
Method CopyFrom:FlxPoint(point:FlxPoint)
x = point.x
y = point.y
return Self
End Method
#Rem
summary:Helper function, just copies the values from this point to the specified point.
Return A reference to the altered point parameter.
[list]
[*]point: Any [a flxpoint.monkey.html]FlxPoint[/a]
[/list]
#End
Method CopyTo:FlxPoint(point:FlxPoint)
point.x = x
point.y = y
return point
End Method
End Class
#Rem
footer:Flixel is an open source game-making library that is completely free for personal or commercial use.
[quote]Copyright: Flixel - 2009-2011 Adam 'Atomic' Saltsman
Copyright: Monkey port - 2011 Arthur 'devolonter' Bikmullin
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:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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.
NOTE FROM THE AUTHOR: As far as I know, you only have to include
this license if you are redistributing source code that includes
the Flixel library. There is no need (or way, afaik) to include
it in your compiled flash games and apps![/quote]
#End