Homebrew COMPLETED [Homebrew] Snake Port (LovePotion)

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
SnakeLogo.jpg



NEW UPDATE: SNAKE Version 4 (New Style, Now working with 5.x.x )

Hey I'm back (again) and I have a brand new version of Snake for LovePotion with me (thx TurtleP & Mik & Co for all the help <3 Bless your discord server).
This time Mik (Renbo Design) from the "Tiny Turtle Industries" Discord supported me with his great artworks. <3 !!!
In addition to that, this is the first time the game is compiled to only 1 NRO file, instead of a whole folder with Lua files.
If you want to look at the code anyways (maybe for learning some LovePotion/Lua) just contact me.
Also this version works with 5.x.x and every other firmware.
Don't forget: The 2 player-mode is started by pressing "+" on the right joycon.

Graphic & Performance Improvements:
  • Complete new graphic style, thanks to Mik (Renbo Design)
  • Vibrations are now implemented but you need to (re-)activate them from the switch main menu
  • Only 1 NRO file for the whole game (no more messy folders!)
  • Works with every firmware (Please report if it doesn't !!!)
  • You can skip the into-screens by pressing "A" or touching the screen.
How to play in 2-Player-Mode:
To activate 2-Player-Mode, the second player just needs to press "+" on the right joycon.
In this mode you will loose your tail when you die and after 90 seconds the player with the longest tail wins ! :yay:
New in this version: There is now a timer where you can see how much time is left.

How to run:
  • Extract inside your /switch folder and run Snake.nro with hbmenu
  • Use the DPad keys or left-joystick for navigation (Player2: x,y,a,b or right-joystick)
  • Press "+" on the right joycon to start into 2PlayerMode
  • Restart the game to get back to SinglePlayer
  • Battle your best friend for a round of good old snake....
  • ..... ?
  • Profit!

Videos:




  • Vibrations work only after you go to the switch-main-menu and re-enable vibrations after every switch boot/restart ..
  • When the head turns you can see a little graphic glitch for a few milliseconds.. I maybe will fix this in the next version.
Version 4 improvements:
  • Complete new graphic style, thanks to Mik (Renbo Design)
  • Compatible with firmware 5.x.x
  • Renbo Design Intro
  • Only 1 NRO file for the whole game
Version 3 improvements:
  • Sound-problems are now fixed
  • Text can now be displayed => new Score & Timer
  • Shrike & LovePotion Intro .. (just because I can ;) )
  • Pressing Buttons on both joycons the same time works now, because of faster execution times of LovePotion
  • No more frame drops because of performance issues
  • Vibrations work, when (re-)activated from the switch-main-menu
Version 2 improvements:
  • Coins spawn on the same grid as the snake now (I'm impressed how people care so much about this xD)
  • Graphic improvements
  • GameOver screen that waits for the sound to be finished playing (to fix the bug with sound delays)
  • 2 PlayerMode (duh)
Hi, I'm the new one :)
Now back to topic:
I made this little port of Snake for the Switch with LovePotion (thx TurtleP & Co for all the help <3 Bless your discord server)
It's nothing special.. (well its the first LovePotion game on switch maybe ??) .. but I thought maybe you like to see it.
Actually it (only) took me about 5h to write it .. but like I said its not something super fancy..
At the moment there is no way we could use text with LovePotion so there is no score .. I guess you just have to count the points yourself :D

PS: If you want to upload this game on any homebrew-appstore-whatever .. Do it! :) You're doing a great job!!
 

Attachments

  • Snake4.zip
    4 MB · Views: 437
Last edited by Shrike,

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,406
Trophies
2
Website
www.flashkarten.tk
XP
3,497
Country
Gambia, The
A few bugs:
-the points to eat spawn completely randomly; not just on the grid of the snake
-The "eat" sound came once although I didn't hit a dot
-The sound stops to work after having eaten a defined amount of food or having restarted (I'm not sure what triggers it)
-The snake doesn't start with 1 length in the original game
-a dot to eat spawned within the snake once
 

sirphayze

Happy camper!
Member
Joined
Oct 30, 2015
Messages
142
Trophies
0
Age
42
Location
In the gray area!
XP
177
Country
First of all: Hi, I'm the new one :)

Now back to topic:
I made this little port of Snake for the Switch with LovePotion (thx TurtleP & Co for all the help <3 Bless your discord server)

It's nothing special.. (well its the first LovePotion game on switch maybe ??) .. but I thought maybe you like to see it.
Actually it (only) took me about 5h to write it .. but like I said its not something super fancy..
At the moment there is no way we could use text with LovePotion so there is no score .. I guess you just have to count the points yourself :D

Here is a video:


How to run:
  • Extract inside your /switch folder and run LovePotion.nro with hbmenu
  • Use the DPad keys for navigation .. (maybe version 2 will have joystick support)
  • ..... ?
  • Profit!
PS: If you want to upload this game on any homebrew-appstore-whatever .. Do it! :) You're doing a great job!!


SWEET! I can finally throw away my Nokia 8850. =)
 

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
-the points to eat spawn completely randomly; not just on the grid of the snake

They should spawn somewhere on the screen (except inside the snake .. I actually forgot to check that xD)
Thats the code atm:
Code:
    self.x = love.math.random(50,1220)
    self.y = love.math.random(50,680)

Switch's sceen size is 1280x720...

The "eat" sound came once although I didn't hit a dot

I guess the dot just spawned right under your head .. lucky :)

The sound stops to work after having eaten a defined amount of food or having restarted (I'm not sure what triggers it)

I was having that trouble, too .. Maybe something with the sound buffer ?? I couldn't find a solution for this .. Its an issue inside LovePotion itself I guess...
We have to remember LovePotion for switch is in a very early version itself..

The snake doesn't start with 1 length in the original game

Ahm .. It should .. And it was for me .. Maybe the first dot spawned right at the start right under your head ??
That would be the solution for your 2 other quotes, too..
Does it always have 1 Tail @ start for you (BESIDE the head) ?
Then maybe there is something wrong with picking a random seed... (so its always the same random values every game)

a dot to eat spawned within the snake once
Yeah like I said .. I did not check this .. lul .. next version, I promise :D

About point count you could setup something fancy with texture?
Actually I thought about this .. But is soo much work xD .. I was just too lazy ..
Because I hope in a few weeks (months?years?) we will have the textfeature anyways .. access to the gpu would help a lot I guess :P
Let's just wait and I will add it when texts are working :)

@All

Thx for the feedback <3
 
Last edited by Shrike,

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,406
Trophies
2
Website
www.flashkarten.tk
XP
3,497
Country
Gambia, The
They should spawn somewhere on the screen (except inside the snake .. I actually forgot to check that xD)
Thats the code atm:
Code:
    self.x = love.math.random(50,1220)
    self.y = love.math.random(50,680)
But they should only spawn in the grid of the snake, so that they directly align to it. It would be better to use something like
Code:
self.x = sizeOfSnakeBlock*love.math.random()
self.y = sizeOfSnakeBlock*love.math.random()
I've attached an image showing the problem, too.

I guess the dot just spawned right under your head .. lucky :)
No it spawned at another position before the sound came.

Ahm .. It should .. And it was for me .. Maybe the first dot spawned right at the start right under your head ??
That would be the solution for your 2 other quotes, too..
Does it always have 1 Tail @ start for you (BESIDE the head) ?
It works like that, but the snake in the original snake games starts with a tail.
 

Attachments

  • snake.jpg
    snake.jpg
    3.3 KB · Views: 321

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
UPDATE: SNAKE2 (+2PlayerMode)

Hey I'm back and I have a brand new version of Snake for LovePotion with me (thx TurtleP & Co for all the help <3 Bless your discord server).
This time you can battle your friends and family !
I also improved some of the graphics and fixed some of the bugs of the first version.

2PlayerMode:
To activate 2PlayerMode, the second player just needs to press "+" on the right joycon.
In this mode you will "only" loose your tail when you die..
After 90 seconds the player with the longest tail wins ! :yay:

:!: IMPORTANT BUG: If you play with 2 players, better one of you uses the joystick of his joycon!
Because of an internal LovePotion Bug pressing 2 buttons (of 2 joycons) the same time will block the input on the left joycon :(
This can be pretty gamebreaking in Multiplayer.. :sad: This Bug does not occur when using the joysticks, though...

Here is a video:



How to run:
  • Extract inside your /switch folder and run LovePotion.nro with hbmenu
  • Use the DPad keys or joystick for navigation (Player2: x,y,a,b or joystick)
  • Press "+" on the right joycon to start into 2PlayerMode
  • Restart the game to get back to SinglePlayer
  • Battle your best friend for a round of good old snake....
  • ..... ?
  • Profit!
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,787
Trophies
1
Age
44
XP
6,516
Country
Germany
UPDATE: SNAKE2 (+2PlayerMode)

Hey I'm back and I have a brand new version of Snake for LovePotion with me (thx TurtleP & Co for all the help <3 Bless your discord server).
This time you can battle your friends and family !
I also improved some of the graphics and fixed some of the bugs of the first version.

2PlayerMode:
To activate 2PlayerMode, the second player just needs to press "+" on the right joycon.
In this mode you will "only" loose your tail when you die..
After 90 seconds the player with the longest tail wins ! :yay:

:!: IMPORTANT BUG: If you play with 2 players, better one of you uses the joystick of his joycon!
Because of an internal LovePotion Bug pressing 2 buttons (of 2 joycons) the same time will block the input on the left joycon :(
This can be pretty gamebreaking in Multiplayer.. :sad: This Bug does not occur when using the joysticks, though...

Here is a video:



How to run:
  • Extract inside your /switch folder and run LovePotion.nro with hbmenu
  • Use the DPad keys or joystick for navigation (Player2: x,y,a,b or joystick)
  • Press "+" on the right joycon to start into 2PlayerMode
  • Restart the game to get back to SinglePlayer
  • Battle your best friend for a round of good old snake....
  • ..... ?
  • Profit!

Fantastic update!
 

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
NEW UPDATE: SNAKE Version 3 (with 2PlayerMode, vibrations & BIG performance updates)

Hey I'm back (again) and I have a brand new version of Snake for LovePotion with me (thx TurtleP & Co for all the help <3 Bless your discord server).
This time you can battle your friends and family !
I also improved some of the graphics and fixed some of the bugs of the first two versions.

Graphic & Performance Improvements:
  • There is now a score for player 1 and 2.
  • Vibrations are now implemented but you need to (re-)activate them from the switch main menu
  • Also in 2Player-Mode you will have a timer where you can see how much time is left.
  • Performance is now much better because of LovePotion is working much faster now. Almost every bug from version 2 is now fixed because of that.
  • Additional I now have a "Intro Preloader" which you can see in the video below..
  • Oh.. and the hbmenu entry has now it's own icon and name :)
How to play in 2-Player-Mode:
To activate 2-Player-Mode, the second player just needs to press "+" on the right joycon.
In this mode you will loose your tail when you die and after 90 seconds the player with the longest tail wins ! :yay:
New in this version: There is now a timer where you can see how much time is left.

Here are some videos:

 
Last edited by Shrike,

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
Would you mind giving me a hint what LovePotion is?
Is it a game engine?

Yep. It is based on Love2D (or Löve). A framework for making 2D games based on the program-language LUA.

Hi there! LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS.
From: https://love2d.org/

@TurtleP ported Love2D to the 3DS and now he is porting it for the Switch, too. ( What is a great job btw, thank you, if you read this :P )
This port of Love2D is called LovePotion.
The great thing about LovePotion is, that you don't need to program on a low level like C or C++.
This makes it a lot easier to get all kind of 2D games to the switch.

This release includes the majority of the rewrite information from the newer 3DS build. On top of that, it includes:
  • Canvases
  • Joystick Module
    • getJoysticks
  • Gamepad callbacks
    • gamepadaxis
    • gamepadpressed
    • gamepadreleased
  • Gamepad objects (Joysticks)
  • Math Module
    • random
    • setRandomSeed
    • getRandomSeed
  • Touch Module
  • Touch callbacks
    • touchpressed
    • touchreleased
    • touchmoved
  • TrueType font support
From: https://github.com/TurtleP/LovePotion/releases/tag/switch-1.0.0

Hope this helps you :yay:
 
  • Like
Reactions: lordelan

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,787
Trophies
1
Age
44
XP
6,516
Country
Germany
Yep. It is based on Love2D (or Löve). A framework for making 2D games based on the program-language LUA.


From: https://love2d.org/

@TurtleP ported Love2D to the 3DS and now he is porting it for the Switch, too. ( What is a great job btw, thank you, if you read this :P )
This port of Love2D is called LovePotion.
The great thing about LovePotion is, that you don't need to program on a low level like C or C++.
This makes it a lot easier to get all kind of 2D games to the switch.


From: https://github.com/TurtleP/LovePotion/releases/tag/switch-1.0.0

Hope this helps you :yay:
Very helpful and interesting, thanks for that! :)
 

Shrike

Well-Known Member
OP
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
SnakeLogo.jpg



NEW UPDATE: SNAKE Version 4 (New Style, Now working with 5.x.x )

Hey I'm back (again) and I have a brand new version of Snake for LovePotion with me (thx TurtleP & Mik & Co for all the help <3 Bless your discord server).
This time Mik (Renbo Design) from the "Tiny Turtle Industries" Discord supported me with his great artworks. <3 !!!
In addition to that, this is the first time the game is compiled to only 1 NRO file, instead of a whole folder with Lua files.
If you want to look at the code anyways (maybe for learning some LovePotion/Lua) just contact me.
Also this version works with 5.x.x and every other firmware.
Don't forget: The 2 player-mode is started by pressing "+" on the right joycon.

Graphic & Performance Improvements:
  • Complete new graphic style, thanks to Mik (Renbo Design)
  • Vibrations are now implemented but you need to (re-)activate them from the switch main menu
  • Only 1 NRO file for the whole game (no more messy folders!)
  • Works with every firmware (Please report if it doesn't !!!)
  • You can skip the into-screens by pressing "A" or touching the screen.
How to play in 2-Player-Mode:
To activate 2-Player-Mode, the second player just needs to press "+" on the right joycon.
In this mode you will loose your tail when you die and after 90 seconds the player with the longest tail wins ! :yay:
New in this version: There is now a timer where you can see how much time is left.

How to run:
  • Extract inside your /switch folder and run Snake.nro with hbmenu
  • Use the DPad keys or left-joystick for navigation (Player2: x,y,a,b or right-joystick)
  • Press "+" on the right joycon to start into 2PlayerMode
  • Restart the game to get back to SinglePlayer
  • Battle your best friend for a round of good old snake....
  • ..... ?
  • Profit!

Videos:
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: The mutated Axolotl was awesome