Bullet

abstract class Bullet(initialX: Int, initialY: Int) : Object

This class represents the bullets in stg and provides shape and coordinate support for bullets for collision detection.

Author

KKoishi_

Parameters

initialX

the initial X coordinates of the bullet.

initialY

the initial Y coordinates of the bullet.

Inheritors

Constructors

Link copied to clipboard
constructor(initialX: Int, initialY: Int)

Properties

Link copied to clipboard
open override val uuid: UUID

The universally unique identifier(UUID) of this object

Functions

Link copied to clipboard
abstract fun collide(o: Object): Boolean

Test if the object collide with another object o.

Link copied to clipboard
abstract fun paint(g: Graphics2D)

Render the object.

Link copied to clipboard
fun pos(): Point

Get the coordinates of the bullet.

Link copied to clipboard
fun setX(nX: Double)
fun setX(nX: Int)
Link copied to clipboard
fun setY(nY: Double)
fun setY(nY: Int)
Link copied to clipboard
abstract fun shape(): Shape

The shape for collide test.

Link copied to clipboard
override fun toString(): String
Link copied to clipboard
abstract fun update(): Boolean

Check the state of the object, and if this need to be removed, true should be returned.

Link copied to clipboard
fun x(): Int

Get the X coordinates of the bullet in int.

Link copied to clipboard
fun xD(): Double

Get the X coordinates of the bullet in double.

Link copied to clipboard
fun y(): Int

Get the Y coordinates of the bullet in int.

Link copied to clipboard
fun yD(): Double

Get the Y coordinates of the bullet in double.