1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
this.add.image(x, y, key)
Adds a static image
preload()
Loads assets like images, sounds, and spritesheets BEFORE creation
create()
Sets up the game objects after loading assets
update(time, delta)
Runs every frame to update game logic. Parameters in this function are optional.
this.add.sprite(x, y, key)
Adds a sprite (for animation)
this.add.text(x, y, ‘text‘, {text options like fontSize, color, etc})
Adds text
this.physics.add.sprite(x, y, key)
Adds a physics-enabled sprite
this.physics.add.collider(obj1, obj2)
Adds collision between objects
this.physics.add.overlap(obj1, obj2, callback)
Detects overlap without stopping movement. A callback can be used to tell the program what should happen after overlap is detected
this.input.keyboard.createCursorKeys()
Creates a cursor that captures arrow key input
this.player.setVelocity(x, y)
Moves a physics sprite
this.tweens.add({ targets, props })
Animates properties like position, scale, alpha
this.cameras.main.shake(duration)
Adds a camera shake effect
this.time.addEvent({ delay, callback, loop })
Creates timed events
this.scene.start(‘SceneKey‘)
Switches to another scene
this.input.on(‘pointerdown‘, callback)
Detects mouse/touch input. A callback is needed to tell the function what to do when it detects either the mouse or touch input
this.input.keyboard.addKey(‘SPACE‘)
Captures specific key presses