iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> Pong Minigame, A Minigame for your Game
DP3
post Jun 30 2012, 08:59 PM
Post #1


Swinging a chain in a town near you.
Group Icon


Type: Writer
Alignment: Lawful Neutral




My first game that I ever made in C++ was Pong, so it seems only fitting that my first ever Ruby script be Pong as well smile.gif

Pong Game

Version: 1.1
Author: DiamondandPlatinum3
Date: July 1, 2012



Planned Future Versions
  • <Version 1.1> Input a menu and Score. Check laugh.gif
  • <Version 1.2> Whatever else needs to be fixed at this point.




Description
This script allows you to play an old retro game called pong in your game.
It would generally be used as a mini game of some sorts, or just a plain old easter egg.

Pong is a game featuring two players and a ball, the ball moves back and forth from one player to the other and the objective is to never miss the ball.
If you miss the ball, your opponent will score a point and the same goes for you, should the opponent miss the ball.
The first person to score 6 points will win the match.



Features
  • Minigame to add for your actual game, can be used for multiple things. A game master challenge using this script along with others comes to mind.
  • Can set your own sprites and music to be used for the minigame, you also chose the sprite dimensions, which means that you can play against a brick wall if you so desire.
  • A command list that can be accessed in the minigame at any time, allowing you to make changes if you're losing to gain that edge you need to win (or to make the game harder if you swing that way).
  • Allows you to set a variable count which you can use in other events to give items or ridicule to the player depending on how they're fairing in the minigame.




Screenshots
Spoiler:








Instructions
Instructions are inside the script, but for immediate need to know:
  • Paste the script under Materials but above Main in your script editor
  • Either copy the sprites in the attachments or create your own and place them in the pictures folder where your game is located on your computer.
  • You can change the names of the sprite images in the editable region.
  • You can use In Game Variable to manage the wins and losses count conditions the same way you would use a variable in an event.
  • Call the game by using a script command with this line of code.
    $scene = Pong_Scene.new




Script
Too Large to put in a code box.
Get it at Pastebin



Credit
  • DP3 / DiamondandPlatinum3




Thanks
  • mcf_10 - for requesting the script
  • Zylos - Because I used his Mastermind Script as a template for my own.
  • Modern Algebra - for helping me with sprite dimensions (I didn't think using 'zoom_x / zoom_y' could be used to zoom out of a sprite )




Support
Post in this thread or PM me.



Known Compatibility Issues
There should be no compatibility issues. smile.gif



Demo
A demo is unnecessary for a script such as this.



Author's Notes
This script is pretty much a port of my C++ Pong Game code (albeit with much more stuff and better code), if you are interested in seeing what it looks like, it can be found here



Terms of Use
If you can find a use for it, this script is free to use in non-commercial games. If you want to use this script in a commercial game, please understand that I expect a free copy (that's means you PM me and let me know that you plan on using it for a commercial game).


This post has been edited by DP3: Sep 1 2012, 02:37 PM
Attached File(s)
Attached File  Background.PNG ( 117.63K ) Number of downloads: 15
Attached File  Ball_Sprite.png ( 149.38K ) Number of downloads: 14
Attached File  LeftPaddle_Sprite.png ( 21.69K ) Number of downloads: 13
Attached File  RightPaddle_Sprite.png ( 61.17K ) Number of downloads: 16
 


--------------------
Go to the top of the page
 
+Quote Post
   
HungrySnake
post Jun 30 2012, 11:35 PM
Post #2



Group Icon


Type: Coder
Alignment: Chaotic Good




Nice script, altough it's really long. 3000 lines is a bit too much, making it more compact will, err I don't know it just feels better when it's compact, I guess it's because of all those comments in your script. I don't comment in my script, except for the instructions and when testing and searching errors etc. But I can understand that you use comments, it's more efficient, but again, it's really long. Maybe someday I'll make a rewrite of it if it's good with you.


--------------------
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Jul 1 2012, 01:58 AM
Post #3



Group Icon


Type: Undisclosed
Alignment: Unaligned




QUOTE (HungrySnake @ Jun 30 2012, 04:35 PM) *
Nice script, altough it's really long. 3000 lines is a bit too much, making it more compact will, err I don't know it just feels better when it's compact, I guess it's because of all those comments in your script. I don't comment in my script, except for the instructions and when testing and searching errors etc. But I can understand that you use comments, it's more efficient, but again, it's really long. Maybe someday I'll make a rewrite of it if it's good with you.


^^^ Ignore his awful advice.


--------------------
I no longer support Tankentai.
Go to the top of the page
 
+Quote Post
   
DP3
post Jul 1 2012, 11:14 AM
Post #4


Swinging a chain in a town near you.
Group Icon


Type: Writer
Alignment: Lawful Neutral




QUOTE (HungrySnake @ Jul 1 2012, 09:35 AM) *
Nice script, altough it's really long. 3000 lines is a bit too much, making it more compact will, err I don't know it just feels better when it's compact, I guess it's because of all those comments in your script. I don't comment in my script, except for the instructions and when testing and searching errors etc. But I can understand that you use comments, it's more efficient, but again, it's really long. Maybe someday I'll make a rewrite of it if it's good with you.

smile.gif

When I did the original version (1.0), I planned on putting comments for the entire thing to explain absolutely everything that was happening (ie making it a nice script for people with no scripting knowledge to look at).
Then came in requests for a menu, followed by requests for options, which was then followed by a request to allow you to store variables which would hold the players wins and losses. blink.gif

This equaled to be a fairly long script compared to the few hundred lines of code at the start.
I had a fair go at commenting things for people with no scripting knowledge, but there is no way in hell that I'm motivated enough to comment that much code to be newbie friendly. unsure.gif
I just haven't gotten rid of the comments I made for that purpose.

All other comments I have made though should actually remain there.
I like knowing which 'end' keyword ends what statement, which is why I do it. wink.gif


I am also unsure why it matters if it's kinda long. The only section people should be looking at is the Description, Instructions and the Editable region. sad.gif


QUOTE (Mr. Bubble @ Jul 1 2012, 11:58 AM) *
^^^ Ignore his awful advice.




--------------------
Go to the top of the page
 
+Quote Post
   
HungrySnake
post Jul 1 2012, 12:58 PM
Post #5



Group Icon


Type: Coder
Alignment: Chaotic Good




I get your point DP3 and I understand that you'd set comments at endings of methods, loops, classes etc. I actually wanted to do that a long time ago but I realised it'd take a long time and since I'm really lazy, I didn't ^^.


--------------------
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Jul 1 2012, 09:39 PM
Post #6



Group Icon


Type: Undisclosed
Alignment: Unaligned




QUOTE (DP3 @ Jul 1 2012, 04:14 AM) *
I am also unsure why it matters if it's kinda long. The only section people should be looking at is the Description, Instructions and the Editable region. sad.gif

It doesn't matter how much comments are in the script because you can pretty much assume the compiler will ignore them when code is converted to machine code.

The point of comments is to make code easier to read and understand. If HungrySnake's intention was to provide a suggestion about efficiency, reducing the line count by removing comments is the wrong way to do it because it'll do absolutely nothing.


--------------------
I no longer support Tankentai.
Go to the top of the page
 
+Quote Post
   
HungrySnake
post Jul 2 2012, 08:39 AM
Post #7



Group Icon


Type: Coder
Alignment: Chaotic Good




I'm not quite used to script with comments in the script itself and that's why I found this one different. I didn't want to be rude, neither I wanted to give advice. I just wanted to mention that it looks kinda weird to me (since I don't use comments in the code) and that the script is scripted well. About the script size, as I mentioned earlier (a couple of times haha) I'm not used to comment in scripts, I don't know why but I can script better when there're no comments around my code. And of course it's a lot more efficient when comments are used, you'll get less errors etc. The problem wasn't about efficiency, but about the script's length, but that doesn't matter, since no one is going to look in the script itself. But that's my scripting style and this is yours and it's a really nice script!


--------------------
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 27th August 2014 - 07:59 AM

RPGMakerVX.net is an Privacy Policy, Legal.