I am facing a challenge that I can't seem to overcome. I need to create a game using HTML, CSS, and JS. The concept involves a grid where upon entering a number into a text box, a picture of a cartoon character is displayed in a square which turns green. Clicking a button then moves the character to another square on the grid, again turning it green. This process continues until the end of the game, requiring the grid (map) to change accordingly. Despite my best efforts in searching for solutions, I have come up empty-handed. Can anyone offer me some guidance? Your help would be greatly appreciated. Wishing you a wonderful day! Below is the script for the grid along with the accompanying HTML representation.
.grid-container {
display: inline-grid;
grid-row-gap: 0px;
grid-column-gap: 0px;
grid-template-columns: auto auto auto auto auto auto;
grid-template-rows: auto auto auto auto auto auto;
background-color: #778899;
padding: 0px;
margin-left:15px;
}
.grid-item {
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid rgba(0, 0, 0, 0.8);
padding: 45px 45px;
font-size: 30px;
text-align: center;
}
<div class="grid-container" id="grid">
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
... (additional grid items)
</div>