[FilterScript] Multiplayer & Singleplayer Snake in SAMP
#1


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!
Reply
#2

Incredible
Reply
#3

Amazing UI.
Reply
#4

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

Cool, +Rep dude
Reply
#6

Looks like fun
Reply
#7

Nice
Reply
#8

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.
Reply
#9

Good job. Reputation added
Reply
#10

Amazing, loved it
Reply
#11



Damn, looks great.
Reply
#12

Amazing, !
Reply
#13

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
Reply
#14

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


Damn, looks great.
pre-ordered?
Reply
#15

Well done. I just skimmed through the code. Looks good.
Reply
#16

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.
Reply
#17

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


Forum Jump:


Users browsing this thread: 2 Guest(s)