You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build game that is similar to building ships in StarDrive 2
it's mean that grid is not square but triangle or any wierd shape like ship.
Anyway, i manage to implement this into your code (i'm not programer but just learning hobbist), so it would be great if you implement it to your code so more people can acess it
"My" method is creating grid with pixel image like this https://www.youtube.com/watch?v=B_Xp9pt8nRY. After that, i just do some corection to your code so it doesn't show eror that you try acess tiles that are dont exist
InvenGritScript
In CreateSlots function, inside iner for cycle i add this
if (color == map.GetPixel (x, y))
{...
..}
so it generate tile just when color (like black pixel) match your pixel map
InvenGridManager
In SlotCheck function, inside iner for cycle i add this
This was actually the next step for the mini project of mine. An irregularly shaped grid. My plan back then was to store the ship layout with a pixel image (same with what you suggested). But It would still spawn all slots. My plan was to add a bool property to each slot that if a slot is placable(part of the ship slots). Then render a background only on the slots that are part of the ship. After, there would be lines on InvenManager that checks if the slots highlighted is all part of the ship.
You basically guessed what I was planning to do. A spaceship that you can put equipment in like a grid inventory. I was using this project to practice and learn unity. The only difference was that you can buy equipment that you can put outside the ship and some that can only be equipped if some part of it is outside(like a gun/cannon, barrel outside/rest of the parts inside). That is why my plans were different from yours.
I don't think I will update/work on this anytime soon. I had to table this project. Did not have much time between work and school. And I am already working on another project.
I'm trying to build game that is similar to building ships in StarDrive 2
it's mean that grid is not square but triangle or any wierd shape like ship.
Anyway, i manage to implement this into your code (i'm not programer but just learning hobbist), so it would be great if you implement it to your code so more people can acess it
"My" method is creating grid with pixel image like this https://www.youtube.com/watch?v=B_Xp9pt8nRY. After that, i just do some corection to your code so it doesn't show eror that you try acess tiles that are dont exist
In CreateSlots function, inside iner for cycle i add this
if (color == map.GetPixel (x, y))
{...
..}
so it generate tile just when color (like black pixel) match your pixel map
In SlotCheck function, inside iner for cycle i add this
if (slotGrid [checkStartPos.x + x, checkStartPos.y + y] != null)
{.....
...}
else return 2;
In both ColorChangeLoop, inde iner for cycle i add this
if (slotGrid[startPos.x + x, startPos.y + y] != null )
{...
...}
And this is result of future ship
The text was updated successfully, but these errors were encountered: