SA-MP Forums Archive
[FilterScript] Multiplayer & Singleplayer Snake in SAMP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Multiplayer & Singleplayer Snake in SAMP (/showthread.php?tid=644571)



Multiplayer & Singleplayer Snake in SAMP - RedFusion - 10.11.2017


TLDR? How to get started can be found at the bottom of the post.

Brief Presentation
With this piece of code you can play snake both solo and against 1-3 other players.

To get started simply use the command /snake ingame.

From there you will be able to navigate yourself into a game in no time with ease with the minimalistic and stylish looking textdraw menus.

Your results will be saved into a local database file that you can browse ingame, and sort by playername in alphabetical order / size / kills / date & time in ascending and descending order.

See it for yourself! Check the video and image album below.

Disclaimer
This code has not been tested enough yet.
Bugs might occur and they will be fixed as soon as they're discovered.

Images
https://imgur.com/a/hTx73

Video


Code
Github Page: https://github.com/fusez/Snake
Download ZIP: https://github.com/fusez/Snake/archive/master.zip

Changelog
10th of November 2017:
* Released

18th of November 2017:
* Replaced Player Textdraws with Textdraws
* 2 Players colliding will now both die, instead of the lowest player ID dying only

How to Get Started
1. Download snake.pwn and put it in your filterscripts folder. Click here to download ZIP.
2. Compile snake.pwn with a compiler of your choice (pawno for example).
3. Load snake by adding it to the filterscripts in server.cfg or load it using the rcon command loadfs snake in the console.
4. Use the command /snake ingame.
5. Enjoy!


Re: Multiplayer & Singleplayer Snake in SAMP - Max_Andolini - 10.11.2017

Incredible


Re: Multiplayer & Singleplayer Snake in SAMP - Eoussama - 10.11.2017

Amazing UI.


Re: Multiplayer & Singleplayer Snake in SAMP - Freaksken - 10.11.2017

Quote:
Originally Posted by Eoussama
View Post
Amazing UI.
Indeed!


Re: Multiplayer & Singleplayer Snake in SAMP - R4nd4ll - 10.11.2017

Cool, +Rep dude


Re: Multiplayer & Singleplayer Snake in SAMP - DonaldDuck - 11.11.2017

Looks like fun


Re: Multiplayer & Singleplayer Snake in SAMP - Ponga - 11.11.2017

Nice


Re: Multiplayer & Singleplayer Snake in SAMP - niCe - 11.11.2017

Good job! I have once created snake game too, but since it was mostly unplayble for players with high ping because of the connection lagging, I replaced it with QUB3D (inspired from GTA 4), which is not affected that much by reaction time.


Re: Multiplayer & Singleplayer Snake in SAMP - Bolex_ - 11.11.2017

Good job. Reputation added


Re: Multiplayer & Singleplayer Snake in SAMP - Puff - 11.11.2017

Amazing, loved it


Re: Multiplayer & Singleplayer Snake in SAMP - Escobabe - 11.11.2017



Damn, looks great.


Re: Multiplayer & Singleplayer Snake in SAMP - Noir - 11.11.2017

Amazing, !


Re: Multiplayer & Singleplayer Snake in SAMP - Pottus - 11.11.2017

It is a cool script however at the same time only a novelty. This script has little viability for a serious server there are too many textdraws.

Код:
#define SNAKE_GRID_WIDTH             15
#define SNAKE_GRID_HEIGHT            15
#define SNAKE_GRID_SIZE              (SNAKE_GRID_WIDTH * SNAKE_GRID_HEIGHT)
That comes out to 225 leaving a mere 31 textdraws which means it is almost certain this script will fail. The snake grid does not need to be player textdraws the snake grid can work as global textdraws instead since changing the color is only shown when you actually show the textdraw.

Check this out.
https://sampforum.blast.hk/showthread.php?tid=602459

You also wasted a bunch of player textdraws that could be global and only ever need be created once instead of destroying/creating them as player textdraws. The only textdraws that should ever be player textdraws are ones that provide individual information. (Apart from the snake grid that is a special case)

It is a cool script but has some serious design flaws that makes this script fall short of being as useful as it could be.

It is hard to rate this script certainly a 5-star from a novelty perspective.
However a 1-star from a viability perspective as it would be useless to anyone serious.

I always give a chance for you to make changes before I rate it anyways


Re: Multiplayer & Singleplayer Snake in SAMP - cuber - 11.11.2017

Quote:
Originally Posted by Escobabe
Посмотреть сообщение


Damn, looks great.
pre-ordered?


Re: Multiplayer & Singleplayer Snake in SAMP - Kar - 13.11.2017

Well done. I just skimmed through the code. Looks good.


Re: Multiplayer & Singleplayer Snake in SAMP - RedFusion - 18.11.2017

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
Changelog
18th of November 2017:
* Replaced Player Textdraws with Textdraws
Quote:
Originally Posted by Pottus
Посмотреть сообщение
Check this out.
https://sampforum.blast.hk/showthread.php?tid=602459

You also wasted a bunch of player textdraws that could be global and only ever need be created once instead of destroying/creating them as player textdraws. The only textdraws that should ever be player textdraws are ones that provide individual information. (Apart from the snake grid that is a special case)
Most of the player textdraws are now regular textdraws, including the snake grid.

Quote:
Originally Posted by Kar
Посмотреть сообщение
Well done. I just skimmed through the code. Looks good.
Thank you.


Re: Multiplayer & Singleplayer Snake in SAMP - Pottus - 18.11.2017

Good one 5-stars from me you covered pretty much of the major setbacks.