J
J
jtag2016-03-01 09:01:03
JavaScript
jtag, 2016-03-01 09:01:03

Javascript game. How to write an enemy object constructor?

Hello, I am writing a platformer game on phaser.js, I wrote the behavior of the main character, I wrote the level, collisions, etc. But I can’t figure out how to create enemies. I assume that a constructor function is created, movement, collisions of enemies with other enemies and other various behaviors of enemies are recorded in it. Then a new object is created based on the constructor or hundreds of enemy objects. Could you explain how this is done in more detail or provide a link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2016-03-01
@msa6886

The official tutorial has an example of an object constructor (Bullet and Weapon classes).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question