Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

how to create multiple instances of same thing?

A topic by jackj106 created Aug 21, 2017 Views: 452 Replies: 2
Viewing posts 1 to 2

i was wondering how one would use functions to make multiple instances of the same entity, for example a enemy that would travel across the screen.  i am hoping this can be done with really simple TIC80 api...

i need this so that enemies can spawn on the right and come at the player that is on the left moving up and down.

this my sound similar to the developers of nesbox and some others because i am remastering Pokey the hedgehog to be improved graphically and stability wise and also adding in a story mode (i might make it a dollar or so, reviewers with channels w/ at least 100 subs get free! (and whoever i choose to give free also))

-jackj106

(1 edit) (+1)

You can make a function where you create and return an entity.

For example:


function createEntity(x,y)
 e={}
e.x= x
e.y = y
return e
end

newEntity = createEntity(10,10)
(1 edit)

thanks. this will help a lot. thanks again