ArrayList Of pictures for a snake game ?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Thu Feb 16, 2017 7:47 pm
ArrayList Of pictures for a snake game ?
I am trying to make a snake game .... without the rectangle function. But most guide use rectangle. So I wanna know if I can make a array with pictures
Re: ArrayList Of pictures for a snake game ?
Sure you can fill your grid with Image references. Then you draw the whole thing by iterating over each row in each column (or the other way around) and draw the Image in that grid cell. Just don't create new Images every time you change cell image, instead create your Images on load and then put references to those images into the grid.
Code: Select all
local image1 = love.graphics.newImage ( "snake123.png" )
--[[ ]]--
grid[ x ][ y ] = image1
--[[ ]]--
love.graphics.draw ( grid[ x ][ y ], xx, yy )
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests