Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TheDreamEXE · May 14, 2015 at 03:50 PM · gridtilerpgrealtime

Grid Based Question

Hello! So I'm new to Unity, and I've been diligently working on the official tutorials, reading the documentation, and some other third party books in an attempt to create a game like Megaman Battle Network in the distant future. My BIGGEST problem however, is creating the main game board. In MMBN, players move in real time on their own 3x3 grids, which change dynamically change as the game goes on. Tiles can break or get stolen by other players, so a match can switch from a 3x3 vs 3x3 board to a 3x2 vs 3x4 board, etc. I need tiles that can change properties as the game progresses, but I don't know how to go about it, conceptually. Ignoring code for now, how would you guys go about this? I was thinking some sort of array for all tiles that would hold all tiles types or something of that manner. Any thoughts? I would love your input, as it would give me a more clear route as to where I'm headed in my practice time. Thanks in advance!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by InsertFunnyUsernameHere · May 14, 2015 at 05:00 PM

1 Create a Tile script responsible for changing the state of a Tile

2 create a script to handle the Tiles (BoardManager)

3 Create a script to generate the board (BoardGenerator)

4 Create an empty GameObject, rename it to Board and attach BoardManager and BoardGenerator

5 Run

Check out "Roguelike 2D" tutorial if you want more specifics

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheDreamEXE · May 14, 2015 at 06:39 PM 0
Share

That sounds like a great idea! Could you elaborate a bit more on a script "Handling" tiles though? Define "handling". I haven't gotten to that tutorial quite yet, but almost there :)

avatar image AlwaysSunny · May 14, 2015 at 06:39 PM 0
Share

Please post non-answers as comments; thanks.

avatar image InsertFunnyUsernameHere · May 14, 2015 at 07:08 PM 0
Share

Put a public static two-dimensional array of type Tile in your Board$$anonymous$$anager and make BoardGenerator instantiate the Tiles and fill the array with references to them something like this:

 //BoardGenerator
 public Tile TilePrefab;
 GameObject Instance = (GameObject)Instantiate(TilePrefab,Vector3(x,y,0f),Quaternion.identity)
 Board$$anonymous$$anager.TileArray[x,y]=Instance.GetComponent<Tile>();



Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Grid Movement VS Free Movement 1 Answer

How can I use the GridBrush in Unity at runtime in the game? 3 Answers

Hexagonal grid with 120 degree angles 1 Answer

Projecting a grid over a mesh 1 Answer

Highlighting Individual Tile Squares 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges