Log In  

Cart #bearmy_demo1-3 | 2020-09-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Hi, just testing out a new demo. Still need to figure out how to create enemies and bullets!

P#81568 2020-09-07 06:18 ( Edited 2020-09-07 21:09)

Dealing with multiple actors (player, enemies, bullets) is easier when, instead of having separate logic for each type of actor (draw and move the player, draw and move the enemies, draw and move the bullets), you have common logic for all your actors and, inside that logic, you check the type of actor (move/draw all actors; if actors is player do this, if enemy do that, if bullet to that.). That way you can have a table that contains all actors and you can just add or remove actors from that table with the ADD and DEL functions.

P#81603 2020-09-08 13:57

But you could also have different tables for each type of actor (a player table, an enemy table, a bullets table) and work like that as well.

P#81604 2020-09-08 13:57

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 10:37:34 | 0.017s | Q:19