
Building Slime Tap: A Behind-the-Scenes Look
Here's a brief insight into how this game came to life.
Every great game starts with an idea. Slime Tap is a simple game you just have to tap the slime back.
The Development Process
This was difficult, I used the Amazon Q assistant but ran into problems with example code and or suggested fixes.
Every project has its hurdles, and was no exception. Some of the notable challenges included:
- Using Amazon Q to size and position things and or debug errors in the code.
- I also think that when you leave the amazon Q interface it resets to the top so you have to scroll back through the chat which is quite frustrating
- Example code I asked to have revied but couldn't get it to work.
- ```
- class Slime extends SpriteComponent with TapCallbacks {
- bool isExpanded = false;
- late Vector2 originalSize;
- static const double animationDuration = 0.3;
- Slime({
- required Sprite sprite,
- required Vector2 position,
- required Vector2 size,
- }) : super(sprite: sprite, position: position, size: size) {
- originalSize = size.clone();
- }
- @override
- bool onTapDown(TapDownInfo info) {
- if (isExpanded) {
- // Shrink back to original size
- size.setFrom(originalSize);
- } else {
- // Expand to screen size
- size.setFrom(gameRef.size);
- }
- isExpanded = !isExpanded;
- return true;
- }
- // For smooth animation
- void smoothScale(bool expand) {
- final targetSize = expand ? gameRef.size : originalSize;
- add(
- ScaleEffect.to(
- targetSize / size,
- EffectController(duration: animationDuration),
- ),
- );
- isExpanded = expand;
- }
- }
- ```
Building Slime tap, quickly I hope it can be enjoyed by everyone. We're excited to continue growing and improving with future projects!