Search found 6 matches
- Sun Jun 09, 2013 8:24 pm
- Forum: Support and Development
- Topic: [Solved] help with animation drawing code.
- Replies: 4
- Views: 2468
Re: help with animation drawing code.
This is what you want: AnimationState_Player = AnimationState_Player + dt if AnimationState_Player > 1 then AnimationState_Player = AnimationState_Player - 1 if Player_CurrentAnimationTile = PlayerAni1 then Player_CurrentAnimationTile = PlayerAni2 else Player_CurrentAnimationTile = PlayerAni1 end e...
- Sun Jun 09, 2013 8:18 pm
- Forum: Support and Development
- Topic: [Solved] help with animation drawing code.
- Replies: 4
- Views: 2468
Re: help with animation drawing code.
Basically I am trying to get CurrentAnimationTile_Player to change between PlayerAni1 and PlayerAni2 every second.
- Sun Jun 09, 2013 7:26 pm
- Forum: Support and Development
- Topic: [Solved] help with animation drawing code.
- Replies: 4
- Views: 2468
[Solved] help with animation drawing code.
PlayerAni1 = love.graphics.newImage("assets/player/player_1.png") PlayerAni2 = love.graphics.newImage("assets/player/player_2.png") I initialized two images which are my two animation frames. seems ok. working fine. Player_CurrentAnimationTile = nil AnimationState_Player = 0 The...
- Thu Jun 06, 2013 4:30 pm
- Forum: Support and Development
- Topic: Getting a error with my draw code.
- Replies: 6
- Views: 2765
Re: Getting a error with my draw code.
In lua, by default, the first index of index elements in table is 1 not 0, so the row of your matrix go from 1 to 6, the column from 1 to 8 You try to access element 0 that does not exist Some advice : You can use #myTable to have the number of indexed elements in table. please in future, give the ...
- Thu Jun 06, 2013 4:00 pm
- Forum: Support and Development
- Topic: Getting a error with my draw code.
- Replies: 6
- Views: 2765
Getting a error with my draw code.
BlockSize = 128 Map_Width = 8 Map_Height = 6 sample_map = { {1,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, } LoadedMatrix = {} function DrawBlock(GridPosX,GridPosY, block) love.graphics.draw(block, GridPosX * BlockSize, GridPosY * B...
- Wed Jun 05, 2013 8:51 pm
- Forum: Support and Development
- Topic: Accessing a multi-dimensional array?
- Replies: 2
- Views: 1515
Accessing a multi-dimensional array?
sample_map = { {1,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, } This is an array which I plan to populate data for my level. I am just wondering, is there a function to access a column on a specific row? for example, I was thinking:...