Snake Game. Customizable

SnakeGame
Customizable: Color, size, separation, speed, radius and background.

1722931500773




InitializeGame

Initialize the Snake Game


StartGame

Start the Snake Game

component_method (8)


PauseGame

Pause the Snake Game

component_method (10)


ResetGame

Reset the Snake Game

component_method (9)


Speed

Set the game speed in milliseconds (lower = faster)

blocks (18)


HeadColor

Set the color of the snake head

blocks (16)


BodyColor

Set the color of the snake body

blocks (15)


FoodColor

Set the color of the food

blocks (13)


GameOverTextColor

Set the color of the Game Over text


Separation

Set the separation between squares

blocks (14)


MoveLeft

Move the snake to the left

component_method (11)


MoveRight

Move the snake to the right

component_method (12)


MoveUp

Move the snake up

component_method (13)


MoveDown

Move the snake down

component_method (14)


IsInitialized

Returns true if the game has been initialized

component_set_get (5)


IsPaused

Returns true if the game is currently paused

component_set_get (4)


IsGameOver

Returns true if the game is over

component_set_get (3)


CurrentScore

Returns the current score

component_set_get (2)


CurrentSpeed

Returns the current speed/difficulty level in milliseconds

component_set_get (1)


GamePaused

Triggered when the game is paused

component_event (6)


GameResumed

Triggered when the game is resumed

component_event (7)


GameOver

Triggered when the game is over

component_event (5)


ScoreChanged

Triggered when the score changes

component_event (4)


Update:

  • Before adding this version (v1.1), you must remove the previous version if you have it. If not, you can continue.

    • If you don't remove the previous version, there will be some errors, as the package name has been updated. The previous version was created with Niotron; this version (v1.1) is created with Fast.
  • Fixed an issue that prevented the snake from colliding when hitting the right and left edges.

  • Changed the SetDifficulty function to Speed. Instead of having default speeds, the user can now set any desired speed.

  • Added new functions, events, and properties.


v1.1 Oct 04, 2025.

SnakeGame.aia (97.7 KB)

joejsanz.joedevsnakegame.aix (15.5 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2025-10-04T07:00:00Z

Built using: FAST-CLI v5.2.0-premium


Thanks.

7 Likes

Please provide example blocks, or an aia project, to show how the less obvious properties are set, and with what values.

1 Like

this extension have a custom canvas or some library java graphics ?

1 Like

this extension have a custom canvas or some library java graphics ?

A webview with JavaScript code,perhaps

1 Like

Ready, I have uploaded the aia project. @TIMAI2

It does not have any library, it does not need a web view, just an Arrangement, the game is offline, it is pure java code.

@CanalDTodoUnPoco_PC
@marco_tanzi

2 Likes

did you write that java code yourself or did you find that code somewhere in the internet? In case of the latter please provide a link to the source and credit its author

Taifun

No libraries, no other people involved.

I think that everything can be done without libraries, although it's more difficult, but not impossible.

It's difficult for me but I like it.

1 Like

Nesse jogo da cobrinha, o fim da partida ocorre corretamente quando a cobra toca na borda superior ou inferior.

Problema:
Quando a cobra encosta na borda direita ou esquerda, o jogo nĂŁo termina. Em vez disso, ela atravessa a tela e reaparece do lado oposto:
Se estiver indo para a direita, ao atingir a borda, reaparece na esquerda e desce uma linha, continuando o movimento para a direita. Esse ciclo se repete até que chegue à borda inferior e o jogo acabe.
Se estiver indo para a esquerda, o processo é semelhante, mas a cada retorno ela sobe uma linha, até alcançar a borda superior e terminar a partida.
Esse comportamento torna o movimento da cobra previsível e pode ser explorado pelos jogadores. Por exemplo: se a comida estiver posicionada na parte inferior, basta deixar a cobra bater na borda direita para que ela siga sozinha, linha por linha, até alcançar a comida, sem esforço do jogador.

A ideia parece ter sido implementada como uma forma de evitar que, caso o jogador pare de jogar, a cobra fique indefinidamente presa nas laterais. Assim, o jogo garante que ela acabe eventualmente ao tocar a borda superior ou inferior.
Porém, essa mecânica abre brechas para atalhos e estratégias fáceis, o que reduz o desafio e compromete a dificuldade original do jogo da cobrinha.

Comentário adaptado com ChatGPT

1 Like

Please add Left, Right and Up, Down buttons for controlling Snake because it is not easy to play by touching the screen

1 Like

Update: v1.1. Oct, 04 2025

2 Likes

Thanks You Very Much Sir

Tested the new Snake Game (v1.1) works perfectly!
The speed, color, and collision updates are all fixed and smooth.
If your old version gives errors, just remove it first before adding this one.

:snake: Great job, everything’s running fine now!

Please Check Speed Block Not Work Propper . I Want Slow Speed=10 But Not Work .

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Hi I Am Testing Your Provided .aia file Please Check Speed Control Block Not Work Propper please :pray:t4:

Thank you.

If you put smaller numbers, you will get more speed, if you want the snake to go slower you must put a larger number.