nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gamnit: fix color buffer clearing issues on some computers
[nit.git]
/
lib
/
scene2d.nit
diff --git
a/lib/scene2d.nit
b/lib/scene2d.nit
index
12167c9
..
2fadd09
100644
(file)
--- a/
lib/scene2d.nit
+++ b/
lib/scene2d.nit
@@
-12,7
+12,7
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
-# 2D management of game elements
+# Framework for 2D management of game elements
#
# TODO: collision framework (with quad tree?)
module scene2d
#
# TODO: collision framework (with quad tree?)
module scene2d
@@
-48,9
+48,16
@@
class Sprite
# height of the sprite
var height: Int = 100 is writable
# height of the sprite
var height: Int = 100 is writable
+ # X coordinate of left side.
fun left: Int do return x - width/2
fun left: Int do return x - width/2
+
+ # X coordinate of right side.
fun right: Int do return x + width/2
fun right: Int do return x + width/2
+
+ # Y coordinate of top.
fun top: Int do return y - height/2
fun top: Int do return y - height/2
+
+ # Y coordinate of bottom.
fun bottom: Int do return y + height/2
# x velocity (applied by `update')
fun bottom: Int do return y + height/2
# x velocity (applied by `update')