Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Elvar

Hi guys.

My TD game i moving along great, but still i am new to Impact, therefor i got some questions i hope you can help me with.

First of all, have a look at the current game @ http://dev11.reload.dk/blomster/ don't mind the retarded loading screen, woke up today, to see my designer fucked it up :).

If you click on the Tower Deck, you can see that a tower spawns, it follows your mouse until clicked on a tile. This works great, now next step would be, not being able to place towers on Roads, Trees, tiles which already consist of a tower.

So i thought about how i could solve this, and this is what i came up with..

I could create a block entity, placing entities in weltmeister where i don't want the player to be able to place towers, then i could check if there was a entity on the position.

However spamming the entity layer with blockedTile entities just seemed a bit ridiculous to me.

So i thought, if i created another collision layer (Blocked tiles) instead, testing for colllision when palcing towers. But this came to an end, when i wasn't able to detect for which collision layer, the collision came from, interfering with the normal collision layer.

So i guess my question is, how should i really approach this?

Also how do check if there is placed an entitie on a tile? :)

Best regards
Elvar

1 decade ago by alexandre

Snap first entity center to center of tile you dropped it over.

Then, as you drag more entities over map to place them, range indicator flashes red or green depending on whether an entity already exists on the map whose center matches center of tile over which cursor hovers.

1 decade ago by StuartTresadern

Alternative is to use a normal background layer that is not draw but use the tile values to indicate states. Set a Map with any static objects set to 1 and as you add new entities check the tile value, if its clear place the entity and update the map cell value.Take a look at the Value Tile Plugin and examples http://impactjs.com/forums/code/tile-value-plugin. Not sure if you will need more than onevalue ? but if you do in the future then you can just introduce new values to your map and code. Could also work in combination with answer from alexandre.

1 decade ago by Elvar

The tile value plugin seems like something i could use.

Thank you for the attention lads, i report back later. :-)

1 decade ago by Elvar

Great plugin Stuart, thank you for your contribution, even tho the indentions were a bit off imo. ^.-

Its works great, and solves my problem, thanks alot.

1 decade ago by StuartTresadern

Hi, I assume you refer to going to the shop to get the tile sets? I have made sure that all the source code / demos are freely available as are the tile sets if you choose to use them (they are optional). All the tile sets I create in the future will only be placed in the shop even the free sets. It’s easier for me to keep track of all graphical assets in a single place. I get that people do not want to register to yet another site especially one with not much content at the moment but I need to put some protection in place. You will not get any spam mail and No information will leave the site. If you do want updates then a newsletter will be available in the future (which you would have to sign up for anyway). Apart from the fact that you had to go to the shop and sign up to get the free tile sheets did you have any other issues? You can always delete your account but if you keep it in place then the site will allow you to re download any assets you purchase (free stuff to) any time in the future.

1 decade ago by Elvar

Hey Stuart.

I didn't actually use your tileset, as we are using a 20x20 tileset. However i did register on your page, (: and no i don't think its too much work to register, for using code you worked hard on :-).

1 decade ago by StuartTresadern

Elvar, sorry I must apologize I read your previous comment as Intentions and not Indentions hence the comment above. What I should have said was, great that it worked for you and Ill clean up the code. I have some 20,24,30,48,50 sets so I will add them to the store.
Page 1 of 1
« first « previous next › last »