AbstractBullet

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

More abstracted class of the bullets, and it is easy to extend it. This is more recommended than Bullet.

If provides the default implementations of update, collide.

Author

KKoishi_

Inheritors

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val uuid: UUID

The universally unique identifier(UUID) of this object

Functions

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

Test if the object collide with another object o.

Link copied to clipboard
open fun collideTest(): Boolean

Collide test, and it is unnecessary to override this method, otherwise you know how this works.

Link copied to clipboard
open fun from(): Entity?

The entity which fired this, and you can just return null.

Link copied to clipboard
abstract fun move()

Determines how the bullet moves.

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
open override 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.