
Game Built: HighLow
Description: HighLow is a number guessing game where the player tries to guess a randomly generated number within a given range. After each guess, the player receives feedback: "Higher" or "Lower," guiding them towards the correct answer.
The code used:
The Game is built and deployed as a simple static website on AmazonS3 and hosted using Amazon Route53. I have utilized Amazon Q for writing the code when required. The website is written in HTML, CSS, and JS.
1. Utilize the AWS web console:
- Check for domain availability on Route53:
- Use the Route 53 dashboard to check if your desired domain name (e.g., "yourgame.com") is available for registration.
- If available, proceed to register the domain.
- Register domain_name and proceed to checkout:
- Complete the domain registration process, including choosing a registrar, selecting a domain name, and providing contact information.
- Proceed to checkout and complete the payment for domain registration.
- Start writing code for the Game utilizing Amazon Q Developer when stuck:
- Use Amazon Q Developer to get assistance with your game's code.
- You can ask questions about JavaScript syntax, debugging, or specific game logic challenges.
- Q Developer can provide code examples, explanations, and suggestions to help you overcome obstacles.
- Create Bucket using S3 (Name Bucket):
- Navigate to the S3 service in the AWS console.
- Create a new S3 bucket with a unique and descriptive name (e.g., "yourgame-bucket").
- Choose a suitable region for your bucket (e.g., a region close to your target audience).
- Select Region:
- Choose the desired region for your bucket. This influences factors like data latency and pricing.
- Open Public Access:
- Important: Carefully consider security implications.
- If your website requires public access, you can enable it by configuring appropriate bucket policies and ACLs.
- Alternatively: Explore more secure options like using CloudFront with signed URLs or private access policies.
- Accept static website hosting:
- Enable static website hosting for your S3 bucket. This allows S3 to serve web content directly.
- Specify the index document (e.g., "index.html") and optional error document (e.g., "404.html").
- Upload the files:
- Upload all the necessary files for your game (HTML, CSS, JavaScript, images, etc.) to the S3 bucket.
- Add base file as index.html:
- Ensure that your
index.html
file is correctly configured as the index document for your bucket.
- Now redirect bucket as Route53 Domain name hosting:
- In Route 53, create a hosted zone for your registered domain.
- Create an A record within the hosted zone that points to the S3 bucket's endpoint.
- This will map your domain name (e.g., "yourgame.com") to your S3 bucket, making your game accessible via your domain.
- Write bucket access policies:
- Implement appropriate bucket policies to control access to your S3 bucket.
- Restrict access to specific IP addresses, AWS accounts, or IAM roles as needed.
- Open and play GAME
- Open a web browser and navigate to your registered domain name (e.g., "yourgame.com").
- You should now be able to access and play your number guessing game.
WHAT'S NEXT:
1. Add UI
2. Make features smarter and more reciprocative
3. Enable multi user play
4. Collect stats and generate Ranking for users
ALL AWS SERVICES USED:
1. AWS Management Console
2. AWS S3
3. AWS Route53
4. Amazon Q Developer
5. Amazon Game Lift
Try the Game: https://high-low-jet.vercel.app/