Search found 51 matches
- Mon May 12, 2014 4:40 pm
- Forum: Support and Development
- Topic: creating new objects when needed
- Replies: 11
- Views: 6523
Re: creating new objects when needed
Leaving the area that spawns the enemy doesn't despawn it.
- Sun May 11, 2014 6:43 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
I have found an alternate solution. Checking pixels in a 640x480 image doesn't lag, does it? So, I came up with the idea of dividing my map to 640x480 segments and only check the segment the player is currently in. I have made a table of the map segments. map = { a1 = { x = 0, y = 0, width = 640, he...
- Sun May 11, 2014 6:33 pm
- Forum: Support and Development
- Topic: creating new objects when needed
- Replies: 11
- Views: 6523
Re: creating new objects when needed
Just don't change the the positions. I only wrote that code to show an example how to change the position of your enemies. If you don't want them to move, delete those two lines.
- Sun May 11, 2014 7:50 am
- Forum: Support and Development
- Topic: creating new objects when needed
- Replies: 11
- Views: 6523
Re: creating new objects when needed
Of course it goes away if you left as it was.
Code: Select all
o.x = o.x + 10 * dt
o.y = o.y + 10 * dt
- Sat May 10, 2014 6:33 pm
- Forum: Support and Development
- Topic: creating new objects when needed
- Replies: 11
- Views: 6523
Re: creating new objects when needed
First of all, you have to create a table, like this: enemies = { } I assume you can handle player positions, x and y. Then you would check if the player is at a certain position. if player.x == something and player.y == something then --do something end or if player.x > something and player.y > some...
- Thu Apr 17, 2014 8:18 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
OK, I will see it tomorrow. Thanks for your time and effort.
- Thu Apr 17, 2014 7:53 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
I haven't tried it yet, but it looks a bit complicated to me.
- Thu Apr 17, 2014 7:40 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
I want pixel collision so much, but I don't know what to do...
- Thu Apr 17, 2014 6:59 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
I was thinking about making a tilemap like this: map={ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 0, 0, 2, 2, 2, 0, 3, 0, 3, 0, 1, 1, 1, 0, 0, 0, 0, 0}, { 0, 1, 0, 0, 2, 0, 2, 0, 3, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 1, 0, 2, 2, 2, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 0, ...
- Thu Apr 17, 2014 5:37 pm
- Forum: Support and Development
- Topic: Checking pixels in tmx files
- Replies: 25
- Views: 12086
Re: Checking pixels in tmx files
I have tried your method, and i think nothing is wrong with it. But there is a problem...again. I made a 2560x1920 map image for testing and the game was stuck with loading it, that's why i was asking the original question. If I can't check pixels in .tmx files, then can I make a tilemap and check t...