Sprites
Create and move game objects. Handle overlaps between objects.
Create sprites
sprites.create(img`.`, SpriteKind.Player)
sprites.createProjectileFromSprite(img`.`, null, 50, 50)
sprites.createProjectileFromSide(img`.`, 50, 50)
Sprite actions
sprites.create(null).say("")
sprites.create(null).overlapsWith(null)
sprites.create(null).destroy()
sprites.create(null).setFlag(0, false)
sprites.create(null).setImage(null)
sprites.create(null).setPosition(0, 0)
sprites.create(null).setKind(0)
sprites.create(null).kind()
sprites.create(null).setBounceOnWall(false)
sprites.create(null).setStayInScreen(false)
sprites.create(null).setScale(1, ScaleAnchor.Middle)
sprites.create(null).changeScale(1, ScaleAnchor.Middle)
Sprite effects
sprites.create(null).startEffect(effects.spray, 500)
effects.clearParticles(null)
Sprite events
sprites.onCreated(0, function (sprite) {})
sprites.onDestroyed(0, function (sprite) {})
sprites.onOverlap(0, 0, function (sprite, otherSprite) {})
Sprite properties
Position
Physics
- vx - velocity x
- vy - velocity y
- ax - acceleration x
- ay - acceleration y
- fx - friction x
- fy - friction y
Image and Attributes
Scaling
See also
create, create projectile from side, create projectile from sprite, say, overlaps with, destroy, set flag, set stay in screen, set bounce on wall, set image, set position, set kind, kind, start effect, clear particles, on created, on destroyed, on overlap, set scale, change scale