SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 12/03/2018, 10:38 PM   #1
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,614
Reputation: 493
Default 1v1 Pong Minigame

1v1 Pong Minigame


This is an Include I've worked on since a while, but I don't really have a use for it so I'll release it.

It's the classic Pong Game, drawn with MaterialText and Objects on an LCD Screen.


You can place the TVs anywhere and players can play on them.
If two players are playing, others can see their game on the Screen and also hear the Game's sounds if close enough.

The first one who joins the game will be the host and he can change the settings and start it once someone joins.

There are some defines you can use to change the screen size, base speed, colors or sounds.


Usage

To use it in a gamemode or filterscript you simply have to include the file.
You can now use the function CreatePongGame to create a "Pong TV" somewhere.

To make players able to join it, you can add a command for hosting a game, joining a game and leaving a game.
See the example Filterscript for a simple example on how to add, start and delete them.


Screenshots/Videos


Here are a few screenshot so you can see how it looks:

https://imgur.com/a/rZBiW

As you can see, you can watch others' games from outside.

Here's a short video (playing one game):

https://www.youtube.com/watch?v=mWCAQ_cNtrA


Notes

- Rotating the TV Screen on the Y Axis does not yet work correctly. Rotating it on the X or Z Axis works as expected.
- If you place many Screens it's recommended to higher the Timer Interval (however it only matters how many games are played simultanously).
- When ingame, other players are still visible for the ones playing.

Bugs/Issues

- No bugs known, please report any bugs you find.
- Because everything is processed server-sided, it might be extremely hard for players with high pings to react properly.


Download

GitHUB: https://github.com/Naseband/SAMP-Pong

See the filterscripts folder for an Example FS. It allows to manage Pong TVs when logged into RCON and playing with others and should give you an idea how to implement it.

The Include uses Incognito's Streamer Plugin for all Objects, include it before pong.inc.
NaS is offline   Reply With Quote
Old 12/03/2018, 10:45 PM   #2
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 327
Reputation: 37
Default Re: 1v1 Pong Minigame

Awesome.
Max_Andolini is online now   Reply With Quote
Old 12/03/2018, 11:23 PM   #3
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,205
Reputation: 1242
Default Re: 1v1 Pong Minigame

Gives me an idea for a new kind of interface framework. Just an idea you should implement paddle acceleration if you hold it for a certain time or hold another key. You could also translate ball speed to paddle speed. That will help clear up the mono-variability in gameplay.

Code:
ballspeed = MIN_BALL_SPEED * currpaddleacceration[playerid];
5/5 for me there is a lot of creativity put into this just to make a simple game a lot has to come together. This is also a great prototype that could lead to development of a more generalized framework (SAMP Arcade?).
Pottus is offline   Reply With Quote
Old 12/03/2018, 11:38 PM   #4
RogerCosta
Huge Clucker
 
RogerCosta's Avatar
 
Join Date: Aug 2014
Location: Santos, Brazil.
Posts: 315
Reputation: 92
Default Re: 1v1 Pong Minigame

Fucking awesome, NaS!

5/5 stars.
RogerCosta is offline   Reply With Quote
Old 12/03/2018, 11:56 PM   #5
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 532
Reputation: 305
Default Re: 1v1 Pong Minigame

That's really creative
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 13/03/2018, 12:05 AM   #6
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,614
Reputation: 493
Default Re: 1v1 Pong Minigame

Quote:
Originally Posted by Pottus View Post
Gives me an idea for a new kind of interface framework. Just an idea you should implement paddle acceleration if you hold it for a certain time or hold another key. You could also translate ball speed to paddle speed. That will help clear up the mono-variability in gameplay.

Code:
ballspeed = MIN_BALL_SPEED * currpaddleacceration[playerid];
5/5 for me there is a lot of creativity put into this just to make a simple game a lot has to come together. This is also a great prototype that could lead to development of a more generalized framework (SAMP Arcade?).
Yeah, the ball movement in general isn't perfect yet and could be improved some more. I could use moveobject which would make it look much smoother. Also the angles of the ball are kind of boring sometimes.

Maybe I'll also implement some kind of other gamemodes or multiple balls, however I must see how exactly that would look like.

I have actually thought of adding more games to the TV System too. However I wonder how many games there are that work really well considering it's all server-sided.
NaS is offline   Reply With Quote
Old 13/03/2018, 01:47 AM   #7
DonaldDuck
Banned
 
Join Date: Jun 2017
Location: Phillipines
Posts: 361
Reputation: 91
Default Re: 1v1 Pong Minigame

Grest work.
DonaldDuck is offline   Reply With Quote
Old 13/03/2018, 02:01 AM   #8
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,817
Reputation: 831
Default Re: 1v1 Pong Minigame

Very noice
__________________

My GitHub:

Gammix is offline   Reply With Quote
Old 13/03/2018, 01:19 PM   #9
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 390
Reputation: 85
Default Re: 1v1 Pong Minigame

Haha good one, this brings back the memories thats for sure,

I do however suggest this is changed to the moveobject method to see how it plays, it's actually quite a powerful method of time keeping and adjusting game speed live in my opinion, plus it will handle far more than 10 games at a time.

Anyway, it's a brilliant release an you should be very proud of yourself
__________________
Killa[DGZ] is offline   Reply With Quote
Old 13/03/2018, 02:30 PM   #10
Whyd
Huge Clucker
 
Whyd's Avatar
 
Join Date: Sep 2012
Location: /
Posts: 439
Reputation: 30
Default Re: 1v1 Pong Minigame

Beautiful and creative, congratulations!
Whyd is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] (Minigame) Don't Get Wet iMonk3y Filterscripts 146 19/02/2015 12:10 PM
[Off] Pong Game RebeloX PortuguÍs/Portuguese 10 19/11/2014 02:17 PM
[FilterScript] Extreme Pong (PvP and PvNPC) Joe Staff Filterscripts 41 11/01/2013 06:44 PM
[Help] With my minigame mickos Scripting Help 11 13/06/2012 04:38 PM
[FilterScript] Ping Pong Extreme Jorge_Hard LanÁamentos/Releases 16 15/03/2011 05:31 PM


All times are GMT. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.