Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 williebotes · May 28, 2018 at 07:46 AM · unity 5randompuzzleplacementwords

Crossword game - How to start a word on a random location of players choice

Hello,

I am working on beginners type of crossword game. The problem I encountered is that this crossword game will not follow the normal pre-defined pattern as normal crossword games. The player must be able to randomly select the start point on the crossword grid. I know this sounds strange but that is the way I need to design this particular game. I have tried numerous ways with my lack of knowledge but can not find a workable way. First the player will get a question. The answer to this question say is "work". He/she then need to select the start point(random) on the grid for the length of the word, in this case 4 letters(4 blocks). Color them say yellow. When the player then click a button to confirm the word it should place the 4 letter word in the 4 yellow selected blocks. If yo can please advice or give me directions on how to achieve this part then I can continue with the development. Thanks in advance Regards

Comment
Add comment · Show 2
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 Harinezumi · May 28, 2018 at 08:28 AM 0
Share

It is a bit unclear how you would like it to work, what are the specific requirements. For example, can the player place the word anywhere where there are 4 free cells, or does the length of the free cells need to match the length of the word?
But based on what I've understood, one way to achieve this is to use InputFields. You can place a number of them in the shape of your crossword puzzle, set them non-interactable (also changing their tinting) and limit the number of characters to 1, then create script that changes the color of the Image component on them to yellow when selected. This would be the first step in what you want to achieve.
Some example code:

 public class CellSelect : $$anonymous$$onoBehaviour {
 
     private Image backgroundImage;
 
     private bool isSelected;
 
     private void Awake () {
         backgroundImage = GetComponent<Image>();
     }
 
     public void SetSelected (bool value) {
         isSelected = value;
         backgroundImage.color = isSelected ? Color.yellow : Color.white;
     }
 
 }

This would be called from the script that handles the user clicking on a crossword cell, the script being on the same game object as the InputField.

avatar image QKlon · May 28, 2018 at 09:23 AM 0
Share

You say, the player selects a start point. All the cells for all letters are marked. How do you get the direction? How are the fields positioned? Like a chess board? Are there fields that cannot be filled?

0 Replies

· Add your reply
  • Sort: 

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

175 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Placing trees randomly across a large terrain 1 Answer

How do I optimize size of my unity word puzzle game? 3 Answers

how to have object fall using random speed 0 Answers

Find tagged children within a specific, dynamically loaded in Prefab gameObject 0 Answers

Random String from list of string without repeated letters 2 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