[Community] The community evolutionary XP scripting project

The community evolutionary script project for RMXP

This is a little fun idea I came up with while drunk.
The basic idea is to apply the 5 word story to a script. I.e. each member built a little on the script.
Since writing a script and writing an easy is not the same there are some differences.
I don't expect anything useful to come out, I just expect some fun :D

Rules
Any posts which does not build on a script are completely ignored. I.e. they don't count in the 3-posts rule.

Rule 1: Choose a script from the last 3 submissions (up to)
You have to a script from the last 3 submissions to build on.
Remember that disqualified submissions does not count.
There are two cases where the choice is limited: (Note that the cases may not be mutually exclusive)
  1. There are less than 3 submissions in the topic. This limits the choice to the amount of submissions.
  2. One of your submissions is among the last 3 submissions. This limits the choice to the submissions made after your own. (Yes, this effectively prevents double submissions)


Rule 2: Code restrictions
Rule 2.1 Only one section
Do not write code which uses more than one sections.

Rule 2.2 Stay in RGSS
No Win32API calls, no file creations, no shell executions, etc.

Rule 2.3 Sprites as only form of visual output
Any visual output must be made using a sprite.

Rule 2.4 Comments
Comments are allowed and are ignored in terms of effect on the script.
There are basically no comment restrictions.


Rule 3: Disqualification
A submissions can be disqualified.
Disqualified submissions are ignored in Rule 1.
I will occasionally check up on this topic and disqualify posts if necessary.

Rule 3.1 Handling 'bad' submissions
By bad submissions I mean submissions which will be disqualified in due time.
There will be a period of time from a bad script is submitted until it is disqualified.
In this time period it is still counted among the 3 submissions in Rule 1
Do not pick the submissions if you can see that it will be disqualified.
You are responsible for checking up on the script you pick being ok.
Follow-up disqualification is a definite possibility. (Avalanche disqualification)

Rule 3.2 Immediate disqualifications
Submissions which break Rule 1 are automatically disqualified even before I edit the post.
This means that you should ignore them immediately.

Rule 3.3 Rule violations
Any Rule 2 violation causes immediate disqualification.
Also of follow up scripts. (Think avalanche effect)
Blatant disregard of Rule 4 & 5 will also cause avalanche disqualification.

Rule 3.4 Errors
Syntax errors cause an avalanche disqualification.
For other errors it's a bit more tricky, since it's not feasible to guarantee
You must be able to start the script and exit without problems.
This rule may be amended if necessary. I will give a notification in that case.


Rule 4: Additions
You may add up to 5 new effective code lines to the script.

Rule 5: Modifications
You may alter up to 3 effective code lines.
This includes removal of script lines.
Note that if you remove one statement and add another in its place it only counts as a modification.
If you add two statements in its place it counts as one modification and one addition.

Elaboration Show
Let's say that we want to swap x and y then one way to do it is:
  1. temp = x
  2. x = y
  3. y = temp
Expand to see the code.


This counts as 3 effective code lines.
You can put it all one line by using ;
  1. temp = x; x = y; y = temp
Expand to see the code.

This still counts as 3 effective the code lines. If you use parallel assignment you get this:
  1. x, y = y, x
Expand to see the code.

That is 1 effective code line.

So there is no reason not to structure it nicely with spacing and line-braking and etc.
Using special language features is encouraged.

In doubt you can look at the grammar for the ruby language with 1 effective code line = 1 statement (stmt)


How to (test) run Show
To run delete everything section except Main.
Replace that with this:

  1. # Create scene
  2. $scene = Scene_OurScene.new
  3. # Call main method
  4. while !$scene.nil?
  5.   $scene.main
  6. end
  7. # Fade out
  8. Graphics.transition(20)
Expand to see the code.


Insert a new section. You can copy the script from a post in there and you should be able to run it.


Rule 6: Submission
Add this in the top of your post if it is a submission:
[size=150]Submission[/size]


If the post does not contain this line it is not considered as a submission.
This (first) post is considered a submission as a special case since it defines the initialize scene.

Be sure to post the entire script and not just the section you have edited.
To ensure the sanity of your fellow scripts please wrap the code in [ruby ][/ruby] or [code ][/code] tags (With the space removed naturally)

It is also a good idea to tell which submission you have picked.



Initial Scene
  1. class Scene_OurScene
  2.   def initialize
  3.     @sprite = Sprite.new
  4.     @sprite.x = 304
  5.     @sprite.y = 224
  6.     @sprite.bitmap = Bitmap.new(32, 32)
  7.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  8.   end
  9.  
  10.   def main
  11.     Graphics.transition
  12.     until $scene != self
  13.       Input.update
  14.       Graphics.update
  15.       update
  16.     end
  17.     Graphics.freeze
  18.     @sprite.dispose
  19.   end
  20.  
  21.   def update
  22.     if Input.press?(Input::C) || Input.press?(Input::B)
  23.       $scene = nil
  24.     elsif Input.press?(Input::LEFT)
  25.       @sprite.x -= 9
  26.     elsif Input.press?(Input::DOWN)
  27.       @sprite.y += 9
  28.     elsif Input.press?(Input::UP)
  29.       @sprite.y -= 9
  30.     elsif Input.press?(Input::RIGHT)
  31.       @sprite.x += 9
  32.     end    
  33.   end
  34. end
Expand to see the code.


*hugs*
  1. # Instead of...
  2. while !$scene.nil?
  3.   $scene.main
  4. end
  5. # Simply use...
  6. $scene.main while !$scene.nil?
Expand to see the code.
You can do that if you want.
You can also do $scene.main until $scene.nil? if you prefer.
It doesn't really matter.

What matters is that the script is compatible with the test script I specified.
Submission

  1. # Based on: Initial Scene (Zeriab)
  2. # Changes: 4 lines (+ 1 comment line) added to OurScene.update for sprite transparency changing on button press functionality
  3.  
  4. # maybe we want to keep this comment formatting stuff up for tracking purposes?
  5. # also, as a kind gift from The Third Man: definition seperators
  6.  
  7. class Scene_OurScene
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   def main
  18.     Graphics.transition
  19.     until $scene != self
  20.       Input.update
  21.       Graphics.update
  22.       update
  23.     end
  24.     Graphics.freeze
  25.     @sprite.dispose
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   def update
  29.     if  Input.press?(Input::A)
  30.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  31.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  32.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  33.       $scene = nil
  34.     elsif Input.press?(Input::LEFT)
  35.       @sprite.x -= 9
  36.     elsif Input.press?(Input::DOWN)
  37.       @sprite.y += 9
  38.     elsif Input.press?(Input::UP)
  39.       @sprite.y -= 9
  40.     elsif Input.press?(Input::RIGHT)
  41.       @sprite.x += 9
  42.     else
  43.       @sprite.opacity += 2 unless @sprite.opacity == 255
  44.     end
  45.   end
  46.   #--------------------------------------------------------------------------
  47. end
Expand to see the code.



For reassurance purposes: I'm only allowed to post if my last post isn't among the last three effective posts, right?
Also, can I / we change existing lines? Moving a gray rectangle around won't be too fun after a while... ^^ (and changing it directly after your script would be pretty damn dumb as well...) There'd also be a need for the C/B keys sooner or later.

Other than that: Awesome idea, I'm surprised this hasn't been done yet... I think I'll enjoy it pretty much :) Let's hope it lives!
I thought that you would just post the script, but I can see my lack of specification may lead to confusion.
I have updated the rules with the concept of a submission and been explicit on what it should contain.
The fact that you should post the entire script containing your changes is now more clear.
Can I get you to post your changes again so it fits with the new rules?

As stated in Rule 1.2 you are allowed to make a submission even if your last submission is among the last three, but you can only choose among submissions made after your last submission. (If your last submission is the last submission, then you cannot post a submission)

Rule 5 states that you can alter up to 3 effective code lines. I have added some elaboration since it was not clear how Rule 4 & Rule 5 works together. The answer is yes. You can change existing lines.

I am glad you like the idea and I also hope it lives ^_^
Please do tell if there are anything else you want clarified.

*hugs*
Changed it accordingly.


First of all, sorry for not reading the rules right... I sometimes have problems with that ;)

Also, regarding the submissions... since you can always choose freely from the last three submissions, including your own, it's theoretically possible for one person to script their very own script by always skipping what others are adding ;)

Also, is it "5 additional lines plus 3 changed lines", or "5 additional lines or 3 changed lines"? And of course, if there's a definition defined, and I change it's handle (for example def produce to def produce(material)), do I have to change all the referers or are they automatically changed along with it? (aka does it count towards the line count).

Just asking questions that might be important in five years from now ^^"


Also: Aren't you participating?

EDIT: Also... why wouldn't it be if Input.trigger?(Input::B) || Input.trigger?(Input::C) ? Oo
BlueScope wrote:
Also, regarding the submissions... since you can always choose freely from the last three submissions, including your own, it's theoretically possible for one person to script their very own script by always skipping what others are adding ;)

Read Rule 1.2 again. I don't see you managed to conclude that :huh:

BlueScope wrote:
First of all, sorry for not reading the rules right... I sometimes have problems with that ;)

:haha:

Sorry, couldn't resist ._.

BlueScope wrote:
Also, is it "5 additional lines plus 3 changed lines", or "5 additional lines or 3 changed lines"? And of course, if there's a definition defined, and I change it's handle (for example def produce to def produce(material)), do I have to change all the referers or are they automatically changed along with it? (aka does it count towards the line count).

It's up to 5 additions plus up to 3 changes.
Changing the handle is one change. You don't have to change all the referers. It's a choice you have to make. There is no freebies for changing the referers. I.e. if you change a referer it counts as a change.

BlueScope wrote:
Also: Aren't you participating?

I will participate ^^

BlueScope wrote:
EDIT: Also... why wouldn't it be if Input.trigger?(Input::B) || Input.trigger?(Input::C) ? Oo

Using .press? instead of .trigger? doesn't break any rules. There is nothing wrong with the way it is now and there would be nothing wrong with you changing it.
You can perfectly fine change it if you want ^_^
Similarly people can keep your commenting style or ignore it.

*hugs*
Submission - Disqualified
  1. # Based on: Script by BlueScope
  2. # Changes: 3 "end" added to OurScene.update for 8 direction movement
  3. #          4 "elsif" changed into "if", moved sprite's opacity part accordingly
  4.  
  5.  
  6. class Scene_OurScene
  7.   #--------------------------------------------------------------------------
  8.   def initialize
  9.     @sprite = Sprite.new
  10.     @sprite.x = 304
  11.     @sprite.y = 224
  12.     @sprite.bitmap = Bitmap.new(32, 32)
  13.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   def main
  17.     Graphics.transition
  18.     until $scene != self
  19.       Input.update
  20.       Graphics.update
  21.       update
  22.     end
  23.     Graphics.freeze
  24.     @sprite.dispose
  25.   end
  26.   #--------------------------------------------------------------------------
  27.   def update
  28.     if  Input.press?(Input::A)
  29.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  30.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  31.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  32.       $scene = nil
  33.     else
  34.       @sprite.opacity += 2 unless @sprite.opacity == 255
  35.     end
  36.     if Input.press?(Input::LEFT)
  37.       @sprite.x -= 9
  38.     end
  39.     if Input.press?(Input::DOWN)
  40.       @sprite.y += 9
  41.     end
  42.     if Input.press?(Input::UP)
  43.       @sprite.y -= 9
  44.     end
  45.     if Input.press?(Input::RIGHT)
  46.       @sprite.x += 9
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50. end
Expand to see the code.

Is it okay ? D:
@Zeriab: I see what you're saying now ^^" Sorry! ^^"

@Micko: I don't really see the '3' and '4' in your comment header, but I know the first line would be this, if following my style:
  1. # Based on: Script by BlueScope
Expand to see the code.

Something like that, simply as an identifier of what script you used as a base... which is really why I'd make it a rule of some sort or something, because otherwise, checking for not rule conform things would be hard after a while...

Also, the sprite now changes opacity back to regular even if moving :(
^^


EDIT:

Submission

  1. # Based on: Script by MicKo
  2. # Changes: 4 lines added to OurScene.update to prevent sprite from moving offscreen
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   def initialize
  7.     @sprite = Sprite.new
  8.     @sprite.x = 304
  9.     @sprite.y = 224
  10.     @sprite.bitmap = Bitmap.new(32, 32)
  11.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   def main
  15.     Graphics.transition
  16.     until $scene != self
  17.       Input.update
  18.       Graphics.update
  19.       update
  20.     end
  21.     Graphics.freeze
  22.     @sprite.dispose
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   def update
  26.     if  Input.press?(Input::A)
  27.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  28.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  29.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  30.       $scene = nil
  31.     else
  32.       @sprite.opacity += 2 unless @sprite.opacity == 255
  33.     end
  34.     if Input.press?(Input::LEFT)
  35.       @sprite.x -= 9
  36.       @sprite.x = 0 if @sprite.x < 0
  37.     end
  38.     if Input.press?(Input::DOWN)
  39.       @sprite.y += 9
  40.       @sprite.y = 448 if @sprite.y > 448
  41.     end
  42.     if Input.press?(Input::UP)
  43.       @sprite.y -= 9
  44.       @sprite.y = 0 if @sprite.y < 0
  45.     end
  46.     if Input.press?(Input::RIGHT)
  47.       @sprite.x += 9
  48.       @sprite.x = 608 if @sprite.x > 608
  49.     end
  50.   end
  51.   #--------------------------------------------------------------------------
  52. end
Expand to see the code.


I really want to move that sprite around now! Too bad I don't have any maker at work :| (someone make a non-RTP demo! :haha: )
I am sorry Micko. The rule clearly states up to 3 modifications while you are perfectly aware that you have made more. You use 4 modifications for elsif => if and one modification for moving the else branch up.

I'll have to disqualify your post.
Since it was only a minor failure I won't disqualify Bluescope's extension ^_^

*hugs*
Submission
  1. # Based on: Script by BlueScope
  2. # Changes: 5 lines added, 2 constants and 3 in update for speed init & boost
  3. #          2 lines changed in update for horizontal speed
  4.  
  5. class Scene_OurScene
  6.   NORMAL_SPEED = 9 # [ADD]
  7.   BOOST_SPEED = 27 # [ADD]
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   def main
  18.     Graphics.transition
  19.     until $scene != self
  20.       Input.update
  21.       Graphics.update
  22.       update
  23.     end
  24.     Graphics.freeze
  25.     @sprite.dispose
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   def update
  29.     speed = NORMAL_SPEED # [ADD]
  30.     if Input.press?(Input::A)
  31.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  32.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  33.     elsif Input.press?(Input::X) # [ADD]
  34.       speed = BOOST_SPEED # [ADD]
  35.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  36.       $scene = nil
  37.     else
  38.       @sprite.opacity += 2 unless @sprite.opacity == 255
  39.     end
  40.     if Input.press?(Input::LEFT)
  41.       @sprite.x -= speed # [MOD]
  42.       @sprite.x = 0 if @sprite.x < 0
  43.     end
  44.     if Input.press?(Input::DOWN)
  45.       @sprite.y += 9
  46.       @sprite.y = 448 if @sprite.y > 448
  47.     end
  48.     if Input.press?(Input::UP)
  49.       @sprite.y -= 9
  50.       @sprite.y = 0 if @sprite.y < 0
  51.     end
  52.     if Input.press?(Input::RIGHT)
  53.       @sprite.x += speed # [MOD]
  54.       @sprite.x = 608 if @sprite.x > 608
  55.     end
  56.   end
  57.   #--------------------------------------------------------------------------
  58. end
Expand to see the code.


In case you are wondering, I am going to split my administrative posts from my submissions.
Submission

  1. # Based on: Script by Zeriab
  2. # Changes: 4 lines (+1 comment line) added in OurScene.update to allow boosting only if not any transparent
  3. #          2 lines changed in OurScene.update for vertical speed
  4. #          plus free bonus seperator for script style purposes, honourably sponsored by The Third Man's workplace
  5.  
  6. class Scene_OurScene
  7.   #--------------------------------------------------------------------------
  8.   NORMAL_SPEED = 9
  9.   BOOST_SPEED = 27
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     @sprite = Sprite.new
  13.     @sprite.x = 304
  14.     @sprite.y = 224
  15.     @sprite.bitmap = Bitmap.new(32, 32)
  16.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   def main
  20.     Graphics.transition
  21.     until $scene != self
  22.       Input.update
  23.       Graphics.update
  24.       update
  25.     end
  26.     Graphics.freeze
  27.     @sprite.dispose
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   def update
  31.     speed = NORMAL_SPEED
  32.     if Input.press?(Input::A)
  33.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  34.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  35.     elsif Input.press?(Input::X)
  36.       # allows boosting if not transparent
  37.       if @sprite.opacity == 255 # ADD
  38.         speed = BOOST_SPEED
  39.       else # ADD
  40.         speed = NORMAL_SPEED # ADD
  41.       end # ADD
  42.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  43.       $scene = nil
  44.     else
  45.       @sprite.opacity += 2 unless @sprite.opacity == 255
  46.     end
  47.     if Input.press?(Input::LEFT)
  48.       @sprite.x -= speed
  49.       @sprite.x = 0 if @sprite.x < 0
  50.     end
  51.     if Input.press?(Input::DOWN)
  52.       @sprite.y += speed # MOD
  53.       @sprite.y = 448 if @sprite.y > 448
  54.     end
  55.     if Input.press?(Input::UP)
  56.       @sprite.y -= speed # MOD
  57.       @sprite.y = 0 if @sprite.y < 0
  58.     end
  59.     if Input.press?(Input::RIGHT)
  60.       @sprite.x += speed
  61.       @sprite.x = 608 if @sprite.x > 608
  62.     end
  63.   end
  64.   #--------------------------------------------------------------------------
  65. end
Expand to see the code.


I also indented the line inbetween my additional lines a bit for scripting style purposes... which I doubt counts as modification, but in any case, I have one left ;)

I really like this thread!
There is nothing with changing white space as long as it doesn't make any semantic changes ^_^
I am glad this thread seems to take of fairly well ^_^

It's also nice to see that you followed up on my speed idea :D
Sorry about the few additionnal lines the last time Zeriab. ;_;

Submission
  1. # Based on: Script by BlueScope
  2. # Changes: 5 lines added in OurScene.initialize to draw a new Sprite.
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   NORMAL_SPEED = 9
  7.   BOOST_SPEED = 27
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @hole_sprite = Sprite.new # ADD
  11.     @hole_sprite.x = 484 # ADD
  12.     @hole_sprite.y = 89  # ADD
  13.     @hole_sprite.bitmap = Bitmap.new(32,32) # ADD
  14.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50)) # ADD
  15.     @sprite = Sprite.new
  16.     @sprite.x = 304
  17.     @sprite.y = 224
  18.     @sprite.bitmap = Bitmap.new(32, 32)
  19.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   def main
  23.     Graphics.transition
  24.     until $scene != self
  25.       Input.update
  26.       Graphics.update
  27.       update
  28.     end
  29.     Graphics.freeze
  30.     @sprite.dispose
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   def update
  34.     speed = NORMAL_SPEED
  35.     if Input.press?(Input::A)
  36.       # makes sprite halfway transparent within [ 64 / Graphics.frame_rate ] seconds
  37.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  38.     elsif Input.press?(Input::X)
  39.       # allows boosting if not transparent
  40.       if @sprite.opacity == 255
  41.         speed = BOOST_SPEED
  42.       else
  43.         speed = NORMAL_SPEED
  44.       end
  45.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  46.       $scene = nil
  47.     else
  48.       @sprite.opacity += 2 unless @sprite.opacity == 255
  49.     end
  50.     if Input.press?(Input::LEFT)
  51.       @sprite.x -= speed
  52.       @sprite.x = 0 if @sprite.x < 0
  53.     end
  54.     if Input.press?(Input::DOWN)
  55.       @sprite.y += speed
  56.       @sprite.y = 448 if @sprite.y > 448
  57.     end
  58.     if Input.press?(Input::UP)
  59.       @sprite.y -= speed
  60.       @sprite.y = 0 if @sprite.y < 0
  61.     end
  62.     if Input.press?(Input::RIGHT)
  63.       @sprite.x += speed
  64.       @sprite.x = 608 if @sprite.x > 608
  65.     end
  66.   end
  67.   #--------------------------------------------------------------------------
  68. end
Expand to see the code.

Damn, I can't dispose my sprite yet. >:o
Of course I followed that idea... that's the purpose of the 5/3 line limit now, isn't it - making other people see what the last person might not be able to complete within their bounds, and complete it for them. ^^ (hence "Community", no? ;) )

And yeah, until now, there's not much happening but the two of us... aka me, as you're hardly doing anything either :> But I think it will RISE :D

EDIT: Of course, it's less fun with people saying what they didn't include yet :(

And yeah... for what reason exactly is @hole_sprite above @sprite? >_< (I can actually tell why you'd do that, but personally, I could live with the next person changing the z value...)


Submission

  1. # Based on: Script by MicKo
  2. # Changes: 2 lines added in OurScene to create sprite appearance changing method
  3. #          1 line added in OurScene.update to call sprite appearance changing method
  4. #          1 line added to OurScene.main to dispose @hole_sprite
  5. #          2 lines shifted around, 1 end tag placed, and 1 line modified in total to eliminate possible transparency bugs in combination with other keys used
  6. #          comments updated for OurScene.update to better reflect what each section does, now that it's better seperated
  7.  
  8. class Scene_OurScene
  9.   #--------------------------------------------------------------------------
  10.   NORMAL_SPEED = 9
  11.   BOOST_SPEED = 27
  12.   #--------------------------------------------------------------------------
  13.   def initialize
  14.     @hole_sprite = Sprite.new
  15.     @hole_sprite.x = 484
  16.     @hole_sprite.y = 89
  17.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  18.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50))
  19.     @sprite = Sprite.new
  20.     @sprite.x = 304
  21.     @sprite.y = 224
  22.     @sprite.bitmap = Bitmap.new(32, 32)
  23.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   def main
  27.     Graphics.transition
  28.     until $scene != self
  29.       Input.update
  30.       Graphics.update
  31.       update
  32.     end
  33.     Graphics.freeze
  34.     @sprite.dispose
  35.     @hole_sprite.dispose # ADD
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     speed = NORMAL_SPEED
  40.     # transparency handler
  41.     if Input.press?(Input::A)
  42.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  43.     else # MOD
  44.       @sprite.opacity += 2 unless @sprite.opacity == 255 # MOD
  45.     end #ADD
  46.     # boost handler
  47.     if Input.press?(Input::X) # MOD
  48.       if @sprite.opacity == 255
  49.         speed = BOOST_SPEED
  50.       else
  51.         speed = NORMAL_SPEED
  52.       end
  53.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  54.       $scene = nil
  55.     end
  56.     # movement handlers
  57.     if Input.press?(Input::LEFT)
  58.       @sprite.x -= speed
  59.       @sprite.x = 0 if @sprite.x < 0
  60.     end
  61.     if Input.press?(Input::DOWN)
  62.       @sprite.y += speed
  63.       @sprite.y = 448 if @sprite.y > 448
  64.     end
  65.     if Input.press?(Input::UP)
  66.       @sprite.y -= speed
  67.       @sprite.y = 0 if @sprite.y < 0
  68.     end
  69.     if Input.press?(Input::RIGHT)
  70.       @sprite.x += speed
  71.       @sprite.x = 608 if @sprite.x > 608
  72.     end
  73.     # sprite's visuals handler
  74.     update_sprite_appearance # ADD
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   def update_sprite_appearance # ADD
  78.   end # ADD
  79.   #--------------------------------------------------------------------------
  80. end
Expand to see the code.
Let's see if I did it right this time...

Submission - Disqualified
  1. # Based on: Script by MicKo and BlueScope's update
  2. # Changes: Turned NORMAL_SPEED and BOOST_SPEED into a single array named SPEED
  3. #          Changed all referrals to NORMAL_SPEED and BOOST_SPEED with SPEED[0] or SPEED[1]
  4. #          After line "if Input.press?(Input::X)" I included a ternary condition to replace the
  5. #          if else one and deleted some lines because of that
  6. #          In line 51 replaced $scene = nil with exit to achieve the same purpose
  7. #          In line 57 changed the speed behavior so it only increments its y coord position value
  8. #          if its last value was lower than 448. Otherwise it does not change it.
  9.  
  10. class Scene_OurScene
  11.   #--------------------------------------------------------------------------
  12.   SPEED = [9, 27] # MOD
  13.   #--------------------------------------------------------------------------
  14.   def initialize
  15.     @hole_sprite = Sprite.new
  16.     @hole_sprite.x = 484
  17.     @hole_sprite.y = 89
  18.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  19.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50))
  20.     @sprite = Sprite.new
  21.     @sprite.x = 304
  22.     @sprite.y = 224
  23.     @sprite.bitmap = Bitmap.new(32, 32)
  24.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  25.   end
  26.   #--------------------------------------------------------------------------
  27.   def main
  28.     Graphics.transition
  29.     until $scene != self
  30.       Input.update
  31.       Graphics.update
  32.       update
  33.     end
  34.     Graphics.freeze
  35.     @sprite.dispose
  36.     @hole_sprite.dispose
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   def update
  40.     speed = SPEED[0] # MOD
  41.     # transparency handler
  42.     if Input.press?(Input::A)
  43.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  44.     else
  45.       @sprite.opacity += 2 unless @sprite.opacity == 255
  46.     end
  47.     # boost handler
  48.     if Input.press?(Input::X)
  49.       speed = @sprite.opacity == 255 ? SPEED[1] : SPEED[0] # MOD
  50.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  51.       exit # MOD
  52.     end
  53.     # movement handlers
  54.     if Input.press?(Input::LEFT)
  55.       @sprite.x -= speed
  56.       @sprite.x = 0 if @sprite.x < 0
  57.     end
  58.     if Input.press?(Input::DOWN)
  59.       @sprite.y += speed if @sprite.y < 448 # MOD
  60.     end
  61.     if Input.press?(Input::UP)
  62.       @sprite.y -= speed
  63.       @sprite.y = 0 if @sprite.y < 0
  64.     end
  65.     if Input.press?(Input::RIGHT)
  66.       @sprite.x += speed
  67.       @sprite.x = 608 if @sprite.x > 608
  68.     end
  69.     # sprite's visuals handler
  70.     update_sprite_appearance
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   def update_sprite_appearance
  74.   end
  75.   #--------------------------------------------------------------------------
  76. end
Expand to see the code.


Is it OK now?
BlueScope wrote:
And yeah... for what reason exactly is @hole_sprite above @sprite? >_< (I can actually tell why you'd do that, but personally, I could live with the next person changing the z value...)

I don't see the problem here, but fine I'll fix that. :p

kyonides, you modified 5 lines instead of 3 and you didn't include "Submission" in your post so I'm going to assume we can't use your submission, sorry. ;_;

Submission
  1. # Based on: Script by BlueScope
  2. # Changes: 2 added lines in Scene_OurScene.initialize
  3. #          3 added lines in Scene_OurScene.update_sprite_appearance
  4. #          3 modified lines in Scene_OurScene.initialize
  5.  
  6. class Scene_OurScene
  7.   #--------------------------------------------------------------------------
  8.   NORMAL_SPEED = 9
  9.   BOOST_SPEED = 27
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     @hole_sprite = Sprite.new
  13.     @hole_sprite.x = 484
  14.     @sprite = Sprite.new
  15.     @sprite.x = 304
  16.     @sprite.y = 224
  17.     @sprite.bitmap = Bitmap.new(32, 32)
  18.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  19.     @hole_sprite.y = 89 # MOD
  20.     @hole_sprite.bitmap = Bitmap.new(32, 32) # MOD
  21.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50)) # MOD
  22.     @hole_sprite.z = @sprite.z - 1 # ADD
  23.     @speed = NORMAL_SPEED # ADD
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   def main
  27.     Graphics.transition
  28.     until $scene != self
  29.       Input.update
  30.       Graphics.update
  31.       update
  32.     end
  33.     Graphics.freeze
  34.     @sprite.dispose
  35.     @hole_sprite.dispose
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     speed = NORMAL_SPEED
  40.     # transparency handler
  41.     if Input.press?(Input::A)
  42.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  43.     else
  44.       @sprite.opacity += 2 unless @sprite.opacity == 255
  45.     end
  46.     # boost handler
  47.     if Input.press?(Input::X)
  48.       if @sprite.opacity == 255
  49.         speed = BOOST_SPEED
  50.       else
  51.         speed = NORMAL_SPEED
  52.       end
  53.     elsif Input.press?(Input::C) || Input.press?(Input::B)
  54.       $scene = nil
  55.     end
  56.     # movement handlers
  57.     if Input.press?(Input::LEFT)
  58.       @sprite.x -= speed
  59.       @sprite.x = 0 if @sprite.x < 0
  60.     end
  61.     if Input.press?(Input::DOWN)
  62.       @sprite.y += speed
  63.       @sprite.y = 448 if @sprite.y > 448
  64.     end
  65.     if Input.press?(Input::UP)
  66.       @sprite.y -= speed
  67.       @sprite.y = 0 if @sprite.y < 0
  68.     end
  69.     if Input.press?(Input::RIGHT)
  70.       @sprite.x += speed
  71.       @sprite.x = 608 if @sprite.x > 608
  72.     end
  73.     # sprite's visuals handler
  74.     update_sprite_appearance
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   def update_sprite_appearance
  78.     if @speed == NORMAL_SPEED # ADD
  79.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196)) # ADD
  80.     end # ADD
  81.   end
  82.   #--------------------------------------------------------------------------
  83. end
Expand to see the code.
MicKo wrote:
BlueScope wrote:
And yeah... for what reason exactly is @hole_sprite above @sprite? >_< (I can actually tell why you'd do that, but personally, I could live with the next person changing the z value...)

I don't see the problem here, but fine I'll fix that. :p
The problem with that is that the two sprites will have the same auto-generated z-level (I think 200?), so they'll virtually be on the same level and therefore be... threaded (dunno any onther way to say that), meaning as long as ones y-value is lower than the others, it'll appear 'lower' on the z axis, and vice versa. Doing it according to your correction, the hole sprite will always stay below the avatar sprite, which is definately what we want ;)

@kyo: You really did violate the rules there quite a bit... what I'll do is somewhat take your idea and include it in a legal way, so we're fine.

Also, I'm not sure you knew what you were doing when modifying the @sprite.y line... that sets your sprite to the bottom of the screen each time you press down, which is... strange and I think unwanted?^^

Other than that, welcome aboard!

Submission

  1. # Based on: Script by MicKo
  2. # Changes: 4 lines added, 3 modified
  3. # (I'm easing the protocolling here up quite a bit, since Zeriab came up with the much easier line tagging)
  4.  
  5. class Scene_OurScene
  6.   #--------------------------------------------------------------------------
  7.   NORMAL_SPEED = 9
  8.   BOOST_SPEED = 27
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     @hole_sprite = Sprite.new
  12.     @hole_sprite.x = 484
  13.     @sprite = Sprite.new
  14.     @sprite.x = 304
  15.     @sprite.y = 224
  16.     @sprite.bitmap = Bitmap.new(32, 32)
  17.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  18.     @hole_sprite.y = 89
  19.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  20.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50))
  21.     @hole_sprite.z = @sprite.z - 1
  22.     @speed = [9, 27] # MOD
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   def main
  26.     Graphics.transition
  27.     until $scene != self
  28.       Input.update
  29.       Graphics.update
  30.       update
  31.     end
  32.     Graphics.freeze
  33.     @sprite.dispose
  34.     @hole_sprite.dispose
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   def update
  38.     speed = NORMAL_SPEED
  39.     @current_speed = @speed[0] # ADD
  40.     # transparency handler
  41.     if Input.press?(Input::A)
  42.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  43.     else
  44.       @sprite.opacity += 2 unless @sprite.opacity == 255
  45.     end
  46.     # boost handler
  47.     if Input.press?(Input::X)
  48.       if @sprite.opacity == 255
  49.         speed = BOOST_SPEED
  50.       else
  51.         speed = NORMAL_SPEED
  52.       end
  53.     end # ADD
  54.     # exit handlers
  55.     if Input.press?(Input::C) || Input.press?(Input::B) # MOD
  56.       $scene = nil
  57.     end
  58.     # movement handlers
  59.     if Input.press?(Input::LEFT)
  60.       @sprite.x -= speed
  61.       @sprite.x = 0 if @sprite.x < 0
  62.     end
  63.     if Input.press?(Input::DOWN)
  64.       @sprite.y += speed
  65.       @sprite.y = 448 if @sprite.y > 448
  66.     end
  67.     if Input.press?(Input::UP)
  68.       @sprite.y -= speed
  69.       @sprite.y = 0 if @sprite.y < 0
  70.     end
  71.     if Input.press?(Input::RIGHT)
  72.       @sprite.x += speed
  73.       @sprite.x = 608 if @sprite.x > 608
  74.     end
  75.     # sprite's visuals handler
  76.     update_sprite_appearance
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   def update_sprite_appearance
  80.     if @current_speed == @speed[0] # MOD
  81.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  82.     elsif @current_speed == @speed[1] # ADD
  83.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0)) # ADD
  84.     end
  85.   end
  86.   #--------------------------------------------------------------------------
  87. end
Expand to see the code.
Oh, thanks for the clarification BlueScope, I didn't know about that, good to know! :D

Ok, here's my Submission, sorry it's messing with a boost, I hope you don't mind.
  1. # Based on: Script by BlueScope
  2. # Changes: 5 lines added, 3 modified
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   NORMAL_SPEED = 9
  7.   BOOST_SPEED = 27
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  15.     @hole_sprite = Sprite.new # MOD
  16.     @hole_sprite.x = 484 # MOD
  17.     @hole_sprite.y = 89
  18.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  19.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50,50,50))
  20.     @hole_sprite.z = @sprite.z - 1
  21.     @speed = [9, 27]
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   def main
  25.     Graphics.transition
  26.     until $scene != self
  27.       Input.update
  28.       Graphics.update
  29.       update
  30.     end
  31.     Graphics.freeze
  32.     @sprite.dispose
  33.     @hole_sprite.dispose
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   def update
  37.     speed = NORMAL_SPEED
  38.     @current_speed = @speed[0]
  39.     # transparency handler
  40.     if Input.press?(Input::A)
  41.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  42.     else
  43.       @sprite.opacity += 2 unless @sprite.opacity == 255
  44.     end
  45.     # boost handler
  46.     if Input.press?(Input::X)
  47.       if @sprite.opacity == 255
  48.         @current_speed += 1 unless @current_speed == @speed[1] # MOD
  49.       else
  50.         speed = NORMAL_SPEED
  51.       end
  52.     else # ADD
  53.     end
  54.     # exit handlers
  55.     if Input.press?(Input::C) || Input.press?(Input::B)
  56.       $scene = nil
  57.     end
  58.     # movement handlers
  59.     if Input.press?(Input::LEFT)
  60.       @sprite.x -= speed
  61.       @sprite.x = 0 if @sprite.x < 0
  62.     end
  63.     if Input.press?(Input::DOWN)
  64.       @sprite.y += speed
  65.       @sprite.y = 448 if @sprite.y > 448
  66.     end
  67.     if Input.press?(Input::UP)
  68.       @sprite.y -= speed
  69.       @sprite.y = 0 if @sprite.y < 0
  70.     end
  71.     if Input.press?(Input::RIGHT)
  72.       @sprite.x += speed
  73.       @sprite.x = 608 if @sprite.x > 608
  74.     end
  75.     # sprite's visuals handler
  76.     update_sprite_appearance
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   def update_sprite_appearance
  80.     if @current_speed == @speed[0]
  81.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  82.     elsif @current_speed == @speed[1]
  83.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  84.     end
  85.     # change sprite's opacity and disallow boost for a moment if touching the hole
  86.     if (@sprite.x + 32).between?(@hole_sprite.x + 8, @hole_sprite.x + 56) && # ADD
  87.     (@sprite.y + 32).between?(@hole_sprite.y + 8, @hole_sprite.y + 56) # ADD
  88.       @sprite.opacity = 100 # ADD
  89.     end # ADD
  90.   end
  91.   #--------------------------------------------------------------------------
  92. end
Expand to see the code.
It's good that people can still learn something from this! (which I know it's dear absent creator Zeriab will like ;) )

Actually, I "learned" something from you before, being this:
  1. @hole_sprite.z = @sprite.z - 1
Expand to see the code.
I seriously never thought about just taking another sprite's z-level and setting the current one 1 below :x


Everything in here was written before I realized I just want to go on... see next post's submission Show
Anyway, regarding your script: First of all, you only added four lines, no matter how many '# ADD's you placed in your script ^^ That is due to the fact that
  1. # if (@sprite.x + 32).between?(@hole_sprite.x + 8, @hole_sprite.x  + 56) && (@sprite.y + 32).between?(@hole_sprite.y + 8, @hole_sprite.y + 56)
Expand to see the code.
is one line, just like Zeriab's example of
  1. temp = x; x = y; y = temp
Expand to see the code.
is three lines - we don't count real line numbers for the rules, but effective lines read by the interpreter (which isn't totally true, as the interpreter reads it as two lines, but it does connect them, so yeah - it counts as one line).

Second, you direct this script in a harsh direction and I just want to make you aware of a certain fact, in case you are not, being the utilization of opacity. I made it a way of controlling the character, as in making you able to purposefully make yourself halfway transparent for not closer defined reasons. You set it as a likely punishing result of stepping into a hole, which is kind of irritating, since unless the player has masochistic tendencies, he probably wouldn't want to trigger enemy effects himself.
That being said, please by all means keep it the way it is if it's intentional, because I can imagine a few ways of how to utilize this ;)

You also advance the value range quite a bit, which has been 255 (100%) and 128 (50%). Now there's also 100 (39something %), which might cause problems later in the handling of opacity changing, and in fact already enables you to stay at a lower value than 128 forever, which is when you press the A button whenever you hit a hole.
I have disqualified kyonides' submission for modifying 5 lines.
Good job spotting it and picking blue's instead Micko :D

@kyo:
Please do try again :3
I did expect a learning period.

@micko & blue:
I am indeed happy that you have already learned something :cute:
This topic seems work even better than I had imagined.

Good work guys.

Oh, and that if (condition) is indeed counted as 1 effective line.

*hugs*
@Zeriab: I'd actually like to request making this "RM XP/VX", as in has to be compatible with both - just for noone in here having to be XP nazi, and me being able to testplay this whatever happens ;) (and of course, for the bit of extra challenge added by having to watch compatibility), especially since there's no reason at all not to do this for a small script like this.

Also, I really think this does work out better than imagined, but not only in learning terms (which actually had to be expected ^^). Personally, I see some (slight) tendencies towards methods on how to improve team scripting/learning solutions. I'm not saying you're the De Bono of RPG Maker now, but yeah... I really think there could be a few (really) helpful techniques coming out of this. Maybe it's just my way-too-unhealthy interest in psychology and stuff, but I'll definately stick around to watch this for some more ;)

So yeah... other than that, please double-check my modification of the conditional earlier added by MicKo, which I'm not entirely sure of if it's conform with the rules. Either way, I demand to let it count because you weren't specific enough in case ;) but yeah... should be fine.


Submission

  1. # Based on: Script by MicKo
  2. # Changes: 5 of 5 lines added, 3 of 3 lines modified
  3. # (again adjusted a bit for better double-checking purposes for new-to-this people)
  4.  
  5. class Scene_OurScene
  6.   #--------------------------------------------------------------------------
  7.   NORMAL_SPEED = 9
  8.   BOOST_SPEED = 27
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     @sprite = Sprite.new
  12.     @sprite.x = 304
  13.     @sprite.y = 224
  14.     @sprite.bitmap = Bitmap.new(32, 32)
  15.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  16.     @hole_sprite = Sprite.new
  17.     @hole_sprite.x = 484
  18.     @hole_sprite.y = 89
  19.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  20.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  21.     @hole_sprite.z = @sprite.z - 1
  22.     @speed = [9, 27]
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   def main
  26.     Graphics.transition
  27.     until $scene != self
  28.       Input.update
  29.       Graphics.update
  30.       update
  31.     end
  32.     Graphics.freeze
  33.     @sprite.dispose
  34.     @hole_sprite.dispose
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   def update
  38.     speed = NORMAL_SPEED
  39.     @current_speed = @speed[0]
  40.     # transparency handler
  41.     if Input.press?(Input::A)
  42.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  43.     else
  44.       @sprite.opacity += 2 unless @sprite.opacity == 255
  45.     end
  46.     # boost handler
  47.     if Input.press?(Input::X)
  48.       if @sprite.opacity == 255
  49.         @current_speed += 1 unless @current_speed == @speed[1]
  50.       else
  51.         speed = NORMAL_SPEED
  52.       end
  53.     else
  54.     end
  55.     # exit handlers
  56.     if Input.press?(Input::C) || Input.press?(Input::B)
  57.       $scene = nil
  58.     end
  59.     # movement handlers
  60.     if Input.press?(Input::LEFT)
  61.       @sprite.x -= speed
  62.       @sprite.x = 0 if @sprite.x < 0
  63.     end
  64.     if Input.press?(Input::DOWN)
  65.       @sprite.y += speed
  66.       @sprite.y = 448 if @sprite.y > 448
  67.     end
  68.     if Input.press?(Input::UP)
  69.       @sprite.y -= speed
  70.       @sprite.y = 0 if @sprite.y < 0
  71.     end
  72.     if Input.press?(Input::RIGHT)
  73.       @sprite.x += speed
  74.       @sprite.x = 608 if @sprite.x > 608
  75.     end
  76.     # sprite's visuals handler
  77.     update_sprite_appearance
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   def update_sprite_appearance
  81.     if @current_speed == @speed[0]
  82.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  83.     elsif @current_speed == @speed[1]
  84.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  85.     end
  86.     # change sprite's opacity and disallow boost for a moment if touching the hole
  87.     if collision_between?(@sprite, @hole_sprite) # MOD
  88.       @sprite.opacity = 128 # MOD
  89.     end
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   def collision_between?(object1, object2, size=[32, 32]) # ADD
  93.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  94.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56) # MOD (moved AND changed, but technically only 1 line modified - valid?)
  95.       return true # ADD
  96.     end # ADD
  97.     return false # ADD
  98.   end # ADD
  99.   #--------------------------------------------------------------------------
  100. end
Expand to see the code.


EDIT: And can you somehow get someone to fucking disable this fucking line count by default? I can't be the only person being annoyed by unintentionally copying these along with scripts now, can I? >_<
Yeah those lines can be annoying some times... ;(

So, here's my Submission! Just... Damn you, first ideas. Tell me if you don't like where it's going, since it's going a really different way I wanted it to go first.
  1. # Based on: Script by BlueScope
  2. # Changes: 5 of 5 lines added, 3 of 3 lines modified
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   NORMAL_SPEED = 9
  7.   BOOST_SPEED = 27
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  15.     @hole_sprite = Sprite.new
  16.     @hole_sprite.x = 484
  17.     @hole_sprite.y = 89
  18.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  19.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  20.     @hole_sprite.z = @sprite.z - 1
  21.     @speed = [9, 27]
  22.     @current_speed = @speed[0] # MOD
  23.     @points = 0 # ADD
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   def main
  27.     Graphics.transition
  28.     until $scene != self
  29.       Input.update
  30.       Graphics.update
  31.       update
  32.     end
  33.     Graphics.freeze
  34.     @sprite.dispose
  35.     @hole_sprite.dispose
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     # transparency handler
  40.     if Input.press?(Input::A)
  41.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  42.     else
  43.       @sprite.opacity += 2 unless @sprite.opacity == 255
  44.     end
  45.     # boost handler
  46.     if Input.press?(Input::X)
  47.       if @sprite.opacity == 255
  48.         @current_speed += 1 unless @current_speed == @speed[1]
  49.       else
  50.         @current_speed -= 1 unless @current_speed == @speed[0] # MOD
  51.       end
  52.     else
  53.       @current_speed -= 1 unless @current_speed == @speed[0] # ADD
  54.     end
  55.     speed = @current_speed # MOD
  56.     # exit handlers
  57.     if Input.press?(Input::C) || Input.press?(Input::B)
  58.       $scene = nil
  59.     end
  60.     # movement handlers
  61.     if Input.press?(Input::LEFT)
  62.       @sprite.x -= speed
  63.       @sprite.x = 0 if @sprite.x < 0
  64.     end
  65.     if Input.press?(Input::DOWN)
  66.       @sprite.y += speed
  67.       @sprite.y = 448 if @sprite.y > 448
  68.     end
  69.     if Input.press?(Input::UP)
  70.       @sprite.y -= speed
  71.       @sprite.y = 0 if @sprite.y < 0
  72.     end
  73.     if Input.press?(Input::RIGHT)
  74.       @sprite.x += speed
  75.       @sprite.x = 608 if @sprite.x > 608
  76.     end
  77.     # sprite's visuals handler
  78.     update_sprite_appearance
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   def update_sprite_appearance
  82.     if @current_speed == @speed[0]
  83.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  84.     elsif @current_speed == @speed[1]
  85.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  86.     end
  87.     # change sprite's opacity and disallow boost for a moment if touching the hole
  88.     if collision_between?(@sprite, @hole_sprite)
  89.       @sprite.opacity = 128
  90.       @hole_sprite.x = rand(608) # ADD
  91.       @hole_sprite.y = rand(448) # ADD
  92.       @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @points % 5 == 0 # ADD
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   def collision_between?(object1, object2, size=[32, 32])
  97.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  98.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
  99.       return true
  100.     end
  101.     return false
  102.   end
  103.   #--------------------------------------------------------------------------
  104. end
Expand to see the code.
While having to take care of compatibility between XP and VX is interesting I would rather have people try to optimize for a specific maker. I think that way you may learn some cool ways to use RGSS features or RGSS2 features.
It is definitely not a bad to also have a VX version so I have made a new topic for VX ^^

Your submission is actually quite interesting since it show a case where the conditional can be an ADD or an MOD. In such a case you can choose whether it's a modification or an addition ^_^

Btw. what's De Bono?

*hugs*
De Bono is a guy who did some research on thinking procedures, eventually coming up with the 'Six-Color Hats Thinking' (I just translated that name to English, so no idea if it's called the same there...), which is basically the method of putting each person a colored hat on, while each hat stands for a certain way of looking at things. So, if you have the hat of objectiveness, you try to look at everything objectively, trying to see the bigger picture instead of what you'd normally think. Same stuff is there for a variety of other opinionating methods, resulting in forcing people to look at things a certain way, and more importantly, have all available people look at the problem from all points of view, not only objectively, for example, which might very well happen normally.
So, it's different from this of course, but I still see similarities in terms of making people work on the same project, but thinking differently. It's a completely different approach, but I think having people to work towards something without anyone telling the others what they're trying to get out of it in the end will be interesting and very productive - given everyone's smart enough to not mess it up.

And as far as the VX topic goes... I think that's a step down. Making a single script will work better than splitting folks up into groups, especially since the people working on both could easily confuse things up. So yeah, I'd rather have XP only (especially since you'Re kinda right about what you said regarding special features, while I don't think we'll get there any soon) than a seperate VX script, but if it finds followers, then it's only positive, no?
Well, here's another SUBMISSION.

  1. # Based on: Script by BlueScope
  2. # Changes: 5 of 5 lines added, 2 of 3 lines modified
  3. # Couldn't add another line to make the new sprite be invisible unless the player
  4. # collides with a hole.
  5.  
  6. class Scene_OurScene
  7.   #--------------------------------------------------------------------------
  8.   NORMAL_SPEED = 9
  9.   BOOST_SPEED = 27
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     @sprite = Sprite.new
  13.     @sprite.x = 304
  14.     @sprite.y = 224
  15.     @sprite.bitmap = Bitmap.new(32, 32)
  16.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  17.     @hole_sprite = Sprite.new
  18.     @hole_sprite.x = 484
  19.     @hole_sprite.y = 89
  20.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  21.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  22.     @alert_sprite = Sprite.new # ADD
  23.     @alert_sprite.x = @sprite.x # ADD
  24.     @alert_sprite.y = @sprite.y-28 # ADD
  25.     @alert_sprite.bitmap = Bitmap.new(64, 24) # ADD
  26.     @alert_sprite.bitmap.draw_text(0, 0, 64, 24, 'Ooops!', 1) # ADD
  27.     @hole_sprite.z = @sprite.z - 1
  28.     @speed = [9, 27]
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   def main
  32.     Graphics.transition
  33.     until $scene != self
  34.       Input.update
  35.       Graphics.update
  36.       update
  37.     end
  38.     Graphics.freeze
  39.     [@sprite, @alert_sprite, @hole_sprite].each {|s| s.dispose} # 2 MODS
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   def update
  43.     speed = NORMAL_SPEED
  44.     @current_speed = @speed[0]
  45.     # transparency handler
  46.     if Input.press?(Input::A)
  47.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  48.     else
  49.       @sprite.opacity += 2 unless @sprite.opacity == 255
  50.     end
  51.     # boost handler
  52.     if Input.press?(Input::X)
  53.       if @sprite.opacity == 255
  54.         @current_speed += 1 unless @current_speed == @speed[1]
  55.       else
  56.         speed = NORMAL_SPEED
  57.       end
  58.     else
  59.     end
  60.     # exit handlers
  61.     if Input.press?(Input::C) || Input.press?(Input::B)
  62.       $scene = nil
  63.     end
  64.     # movement handlers
  65.     if Input.press?(Input::LEFT)
  66.       @sprite.x -= speed
  67.       @sprite.x = 0 if @sprite.x < 0
  68.     end
  69.     if Input.press?(Input::DOWN)
  70.       @sprite.y += speed
  71.       @sprite.y = 448 if @sprite.y > 448
  72.     end
  73.     if Input.press?(Input::UP)
  74.       @sprite.y -= speed
  75.       @sprite.y = 0 if @sprite.y < 0
  76.     end
  77.     if Input.press?(Input::RIGHT)
  78.       @sprite.x += speed
  79.       @sprite.x = 608 if @sprite.x > 608
  80.     end
  81.     # sprite's visuals handler
  82.     update_sprite_appearance
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   def update_sprite_appearance
  86.     if @current_speed == @speed[0]
  87.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  88.     elsif @current_speed == @speed[1]
  89.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  90.     end
  91.     # change sprite's opacity and disallow boost for a moment if touching the hole
  92.     if collision_between?(@sprite, @hole_sprite)
  93.       @sprite.opacity = 128
  94.     end
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   def collision_between?(object1, object2, size=[32, 32])
  98.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  99.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
  100.       return true
  101.     end
  102.     return false
  103.   end
  104.   #--------------------------------------------------------------------------
  105. end
Expand to see the code.
I'm actually going to build upon MicKo's Version, which for some reason you (kyo) didn't use... it actually includes some gameplay, so I'd like to go with it even though you have a good idea there, too...

@MicKo: That's what I was talking about before - it doesn't really matter if someone else likes your script, because there's not one person shaping it (and certainly not me ^^" ), but everyone... hence 'Community' :p


Submission

  1. # Based on: Script by MicKo
  2. # Changes: 5 of 5 lines added, 3 of 3 lines modified
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   NORMAL_SPEED = 9
  7.   BOOST_SPEED = 27
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  15.     @hole_sprite = Sprite.new
  16.     @hole_sprite.x = 484
  17.     @hole_sprite.y = 89
  18.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  19.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  20.     @hole_sprite.z = @sprite.z - 1
  21.     @speed = [9, 27]
  22.     @current_speed = @speed[0]
  23.     @points = 0
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # please leave this alone if you don't know what you're doing
  27.   def draw_sprite(sprite, type) # ADD
  28.     case type # ADD
  29.     when 0 # ADD
  30.     end # ADD
  31.   end # ADD
  32.   #--------------------------------------------------------------------------
  33.   def main
  34.     Graphics.transition
  35.     until $scene != self
  36.       Input.update
  37.       Graphics.update
  38.       update
  39.     end
  40.     Graphics.freeze
  41.     @sprite.dispose
  42.     @hole_sprite.dispose
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   def update
  46.     # transparency handler
  47.     if Input.press?(Input::A)
  48.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  49.     else
  50.       @sprite.opacity += 2 unless @sprite.opacity == 255
  51.     end
  52.     # boost handler
  53.     if Input.press?(Input::X)
  54.       if @sprite.opacity == 255
  55.         @current_speed += 1 unless @current_speed == @speed[1]
  56.       else
  57.         @current_speed -= 1 unless @current_speed == @speed[0]
  58.       end
  59.     else
  60.       @current_speed -= 1 unless @current_speed == @speed[0]
  61.     end
  62.     speed = @current_speed # MOD
  63.     # exit handlers
  64.     if Input.press?(Input::C) || Input.press?(Input::B)
  65.       $scene = nil
  66.     end
  67.     # movement handlers
  68.     if Input.press?(Input::LEFT)
  69.       @sprite.x -= speed
  70.       @sprite.x = 0 if @sprite.x < 0
  71.     end
  72.     if Input.press?(Input::DOWN)
  73.       @sprite.y += speed
  74.       @sprite.y = 448 if @sprite.y > 448
  75.     end
  76.     if Input.press?(Input::UP)
  77.       @sprite.y -= speed
  78.       @sprite.y = 0 if @sprite.y < 0
  79.     end
  80.     if Input.press?(Input::RIGHT)
  81.       @sprite.x += speed
  82.       @sprite.x = 608 if @sprite.x > 608
  83.     end
  84.     # MODx3: three lines removed
  85.     # sprite's visuals handler
  86.     if @current_speed == @speed[0]
  87.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  88.     elsif @current_speed == @speed[1]
  89.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  90.     end
  91.     # handles collision with hole
  92.     if collision_between?(@sprite, @hole_sprite)
  93.       @sprite.opacity = 128
  94.       @hole_sprite.x = rand(608)
  95.       @hole_sprite.y = rand(448)
  96.       @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @points % 5 == 0
  97.     end
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   def collision_between?(object1, object2, size=[32, 32])
  101.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  102.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
  103.       return true
  104.     end
  105.     return false
  106.   end
  107.   #--------------------------------------------------------------------------
  108. end
Expand to see the code.
SUBMISSION - Disqualified

  1. # Based on: my previous version of this script
  2. # Changes: 5 of 5 lines added, 0 of 3 lines modified
  3. # Couldn't add another line to make the new sprite be invisible unless the player
  4. # collides with a hole.
  5.  
  6. class Scene_OurScene
  7.   #--------------------------------------------------------------------------
  8.   NORMAL_SPEED = 9
  9.   BOOST_SPEED = 27
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     @sprite = Sprite.new
  13.     @sprite.x = 304
  14.     @sprite.y = 224
  15.     @sprite.bitmap = Bitmap.new(32, 32)
  16.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  17.     @hole_sprite = Sprite.new
  18.     @hole_sprite.x = 484
  19.     @hole_sprite.y = 89
  20.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  21.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  22.     @alert_sprite = Sprite.new
  23.     @alert_sprite.x = @sprite.x
  24.     @alert_sprite.y = @sprite.y-28
  25.     @alert_sprite.bitmap = Bitmap.new(64, 24)
  26.     @alert_sprite.bitmap.draw_text(0, 0, 64, 24, 'Ooops!', 1)
  27.     @alert_sprite.visible = false # ADD
  28.     @hole_sprite.z = @sprite.z - 1
  29.     @speed = [9, 27]
  30.     @points = 0 # ADD - BlueScope's or Micko's idea
  31.     @next_level_points = 475 # ADD
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   def main
  35.     Graphics.transition
  36.     until $scene != self
  37.       Input.update
  38.       Graphics.update
  39.       update
  40.     end
  41.     Graphics.freeze
  42.     [@sprite, @alert_sprite, @hole_sprite].each {|s| s.dispose}
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   def update
  46.     speed = NORMAL_SPEED
  47.     @current_speed = @speed[0]
  48.     # transparency handler
  49.     if Input.press?(Input::A)
  50.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  51.     else
  52.       @sprite.opacity += 2 unless @sprite.opacity == 255
  53.     end
  54.     # boost handler
  55.     if Input.press?(Input::X)
  56.       if @sprite.opacity == 255
  57.         @current_speed += 1 unless @current_speed == @speed[1]
  58.       else
  59.         speed = NORMAL_SPEED
  60.       end
  61.     else
  62.     end
  63.     # exit handlers
  64.     if Input.press?(Input::C) || Input.press?(Input::B)
  65.       $scene = nil
  66.     end
  67.     # movement handlers
  68.     if Input.press?(Input::LEFT)
  69.       @sprite.x -= speed
  70.       @sprite.x = 0 if @sprite.x < 0
  71.     end
  72.     if Input.press?(Input::DOWN)
  73.       @sprite.y += speed
  74.       @sprite.y = 448 if @sprite.y > 448
  75.     end
  76.     if Input.press?(Input::UP)
  77.       @sprite.y -= speed
  78.       @sprite.y = 0 if @sprite.y < 0
  79.     end
  80.     if Input.press?(Input::RIGHT)
  81.       @sprite.x += speed
  82.       @sprite.x = 608 if @sprite.x > 608
  83.     end
  84.     # sprite's visuals handler
  85.     update_sprite_appearance
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   def update_sprite_appearance
  89.     if @current_speed == @speed[0]
  90.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  91.     elsif @current_speed == @speed[1]
  92.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  93.     end
  94.     # change sprite's opacity and disallow boost for a moment if touching the hole
  95.     if collision_between?(@sprite, @hole_sprite)
  96.       @sprite.opacity = 128
  97.       @alert_sprite.visible = true # ADD
  98.       @points -= 5 # ADD
  99.     end
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   def collision_between?(object1, object2, size=[32, 32])
  103.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  104.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
  105.       return true
  106.     end
  107.     return false
  108.   end
  109.   #--------------------------------------------------------------------------
  110. end
Expand to see the code.
Zeriab wrote:
Rules
[...]

Rule 1: Choose a script from the last 3 submissions (up to)
You have to a script from the last 3 submissions to build on.
Remember that disqualified submissions does not count.
There are two cases where the choice is limited: (Note that the cases may not be mutually exclusive)
  1. There are less than 3 submissions in the topic. This limits the choice to the amount of submissions.
  2. One of your submissions is among the last 3 submissions. This limits the choice to the submissions made after your own. (Yes, this effectively prevents double submissions)


Also, without trying to get you down or anything (I really think you should be in this topic, looking at your general scripts I've seen), I think we can expect people in a forum about scripting to follow a simple tagging guideline... even if it requires a [size] tag... ^^
Followed BlueScope :
Submission
  1. # Based on: Script by BlueScope
  2. # Changes: 5 of 5 lines added, 3 of 3 lines modified
  3.  
  4. class Scene_OurScene
  5.   #--------------------------------------------------------------------------
  6.   NORMAL_SPEED = 9
  7.   BOOST_SPEED = 27
  8.   #--------------------------------------------------------------------------
  9.   def initialize
  10.     @sprite = Sprite.new
  11.     @sprite.x = 304
  12.     @sprite.y = 224
  13.     @sprite.bitmap = Bitmap.new(32, 32)
  14.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  15.     @hole_sprite = Sprite.new
  16.     @hole_sprite.x = 484
  17.     @hole_sprite.y = 89
  18.     @hole_sprite.bitmap = Bitmap.new(32, 32)
  19.     @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
  20.     @hole_sprite.z = @sprite.z - 1
  21.     @speed = [9, 27]
  22.     @current_speed = @speed[0]
  23.     @score = 0 # MOD
  24.     @score_max = 999999999 # ADD
  25.     @score_sprite = Sprite.new # ADD
  26.     @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40) # ADD
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # please leave this alone if you don't know what you're doing
  30.   def draw_sprite(sprite, type)
  31.     case type
  32.     when 0
  33.     end
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   def main
  37.     Graphics.transition
  38.     until $scene != self
  39.       Input.update
  40.       Graphics.update
  41.       update
  42.     end
  43.     Graphics.freeze
  44.     @sprite.dispose
  45.     @hole_sprite.dispose
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   def update
  49.     # transparency handler
  50.     if Input.press?(Input::A)
  51.       @sprite.opacity -= 2 unless @sprite.opacity <= 128
  52.     else
  53.       @sprite.opacity += 2 unless @sprite.opacity == 255
  54.     end
  55.     # boost handler
  56.     if Input.press?(Input::X)
  57.       if @sprite.opacity == 255
  58.         @current_speed += 1 unless @current_speed == @speed[1]
  59.       else
  60.         @current_speed -= 1 unless @current_speed == @speed[0]
  61.       end
  62.     else
  63.       @current_speed -= 1 unless @current_speed == @speed[0]
  64.     end
  65.     speed = @current_speed
  66.     # exit handlers
  67.     if Input.press?(Input::C) || Input.press?(Input::B)
  68.       $scene = nil
  69.     end
  70.     # movement handlers
  71.     if Input.press?(Input::LEFT)
  72.       @sprite.x -= speed
  73.       @sprite.x = 0 if @sprite.x < 0
  74.     end
  75.     if Input.press?(Input::DOWN)
  76.       @sprite.y += speed
  77.       @sprite.y = 448 if @sprite.y > 448
  78.     end
  79.     if Input.press?(Input::UP)
  80.       @sprite.y -= speed
  81.       @sprite.y = 0 if @sprite.y < 0
  82.     end
  83.     if Input.press?(Input::RIGHT)
  84.       @sprite.x += speed
  85.       @sprite.x = 608 if @sprite.x > 608
  86.     end
  87.     # sprite's visuals handler
  88.     if @current_speed == @speed[0]
  89.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
  90.     elsif @current_speed == @speed[1]
  91.       @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
  92.     end
  93.     # handles collision with hole
  94.     if collision_between?(@sprite, @hole_sprite)
  95.       #MOD : @sprite.opacity = 128 removed
  96.       @score += 1 # ADD
  97.       @hole_sprite.x = rand(608)
  98.       @hole_sprite.y = rand(448)
  99.       @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0 # MOD
  100.       @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0] # ADD
  101.     end
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   def collision_between?(object1, object2, size=[32, 32])
  105.     if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
  106.         (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
  107.       return true
  108.     end
  109.     return false
  110.   end
  111.   #--------------------------------------------------------------------------
  112. end
Expand to see the code.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=70279