Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Community] The community evolutionary XP scripting project

Zeriab

Sponsor

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

[ruby]# Based on: Script by MicKo
# Changes: 5 of 5 lines added, 3 of 3 lines modified
# (again adjusted a bit for better double-checking purposes for new-to-this people)
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    speed = NORMAL_SPEED
    @current_speed = @speed[0]
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        speed = NORMAL_SPEED
      end
    else
    end
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    update_sprite_appearance
  end
  #--------------------------------------------------------------------------
  def update_sprite_appearance
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # change sprite's opacity and disallow boost for a moment if touching the hole
    if collision_between?(@sprite, @hole_sprite) # MOD
      @sprite.opacity = 128 # MOD
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32]) # ADD
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56) # MOD (moved AND changed, but technically only 1 line modified - valid?)
      return true # ADD
    end # ADD
    return false # ADD
  end # ADD
  #--------------------------------------------------------------------------
end
[/ruby]

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? >_<
 

MicKo

Member

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.
[ruby]# Based on: Script by BlueScope
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0] # MOD
    @points = 0 # ADD
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0] # MOD
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0] # ADD
    end
    speed = @current_speed # MOD
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    update_sprite_appearance
  end
  #--------------------------------------------------------------------------
  def update_sprite_appearance
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # change sprite's opacity and disallow boost for a moment if touching the hole
    if collision_between?(@sprite, @hole_sprite)
      @sprite.opacity = 128
      @hole_sprite.x = rand(608) # ADD
      @hole_sprite.y = rand(448) # ADD
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @points % 5 == 0 # ADD
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 

Zeriab

Sponsor

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.

[rgss]# Based on: Script by BlueScope
# Changes: 5 of 5 lines added, 2 of 3 lines modified
# Couldn't add another line to make the new sprite be invisible unless the player
# collides with a hole.
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @alert_sprite = Sprite.new # ADD
    @alert_sprite.x = @sprite.x # ADD
    @alert_sprite.y = @sprite.y-28 # ADD
    @alert_sprite.bitmap = Bitmap.new(64, 24) # ADD
    @alert_sprite.bitmap.draw_text(0, 0, 64, 24, 'Ooops!', 1) # ADD
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    [@sprite, @alert_sprite, @hole_sprite].each {|s| s.dispose} # 2 MODS
  end
  #--------------------------------------------------------------------------
  def update
    speed = NORMAL_SPEED
    @current_speed = @speed[0]
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        speed = NORMAL_SPEED
      end
    else
    end
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    update_sprite_appearance
  end
  #--------------------------------------------------------------------------
  def update_sprite_appearance
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # change sprite's opacity and disallow boost for a moment if touching the hole
    if collision_between?(@sprite, @hole_sprite)
      @sprite.opacity = 128
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/rgss]
 
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

[ruby]# Based on: Script by MicKo
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @points = 0
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type) # ADD
    case type # ADD
    when 0 # ADD
    end # ADD
  end # ADD
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed # MOD
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # MODx3: three lines removed
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @sprite.opacity = 128
      @hole_sprite.x = rand(608)
      @hole_sprite.y = rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @points % 5 == 0
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 
SUBMISSION - Disqualified

[rgss]# Based on: my previous version of this script
# Changes: 5 of 5 lines added, 0 of 3 lines modified
# Couldn't add another line to make the new sprite be invisible unless the player
# collides with a hole.
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @alert_sprite = Sprite.new
    @alert_sprite.x = @sprite.x
    @alert_sprite.y = @sprite.y-28
    @alert_sprite.bitmap = Bitmap.new(64, 24)
    @alert_sprite.bitmap.draw_text(0, 0, 64, 24, 'Ooops!', 1)
    @alert_sprite.visible = false # ADD
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @points = 0 # ADD - BlueScope's or Micko's idea
    @next_level_points = 475 # ADD
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    [@sprite, @alert_sprite, @hole_sprite].each {|s| s.dispose}
  end
  #--------------------------------------------------------------------------
  def update
    speed = NORMAL_SPEED
    @current_speed = @speed[0]
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        speed = NORMAL_SPEED
      end
    else
    end
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    update_sprite_appearance
  end
  #--------------------------------------------------------------------------
  def update_sprite_appearance
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # change sprite's opacity and disallow boost for a moment if touching the hole
    if collision_between?(@sprite, @hole_sprite)
      @sprite.opacity = 128
      @alert_sprite.visible = true # ADD
      @points -= 5 # ADD
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/rgss]
 
Zeriab":3da4ep7u said:
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... ^^
 

MicKo

Member

Followed BlueScope :
Submission
[ruby]# Based on: Script by BlueScope
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0 # MOD
    @score_max = 999999999 # ADD
    @score_sprite = Sprite.new # ADD
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40) # ADD
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      #MOD : @sprite.opacity = 128 removed
      @score += 1 # ADD
      @hole_sprite.x = rand(608)
      @hole_sprite.y = rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0 # MOD
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0] # ADD
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x + 8, object2.x + 56) &&
        (object1.y + size[1]).between?(object2.y + 8, object2.y + 56)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 
Well, I did it on purpose because it seemed my previous submissions were ignored. It was like a pacifist way to protest against that hahaha.
 
That's why I said please don't feel left out or anything ^^" You skipped a previous submission, essentially putting the next poster in the position of choosing between two. I personally find the random placement quite cool, so yeah... believe me it's only bad luck ^^"
 

Zeriab

Sponsor

The post was naturally disqualified ^^

I have updated the rules so submission which break rule 1 can be ignored before I edit the post.
The reason is that I noticed a possible 'exploit' where a malicious scripter can quadruple post effectively freezing this topic until I clear it up. (I am not saying you are a malicious poster kyo :cute: )

There is a definite danger of your submission being ignored.
 

Zeriab

Sponsor

Submission
Code:
# Based on: Script by Micko

# Changes: 3 of 5 lines added, 1 of 3 lines modified

 

class Scene_OurScene

  #--------------------------------------------------------------------------

  NORMAL_SPEED = 9

  BOOST_SPEED = 27

  #--------------------------------------------------------------------------

  def initialize

    @sprite = Sprite.new

    @sprite.x = 304

    @sprite.y = 224

    @sprite.bitmap = Bitmap.new(32, 32)

    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))

    @hole_sprite = Sprite.new

    @hole_sprite.x = 484

    @hole_sprite.y = 89

    @hole_sprite.bitmap = Bitmap.new(32, 32)

    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(50, 50, 50))

    @hole_sprite.ox = @hole_sprite.bitmap.width / 2  # ADD

    @hole_sprite.oy = @hole_sprite.bitmap.height / 2  # ADD

    @hole_sprite.z = @sprite.z - 1

    @speed = [9, 27]

    @current_speed = @speed[0]

    @score = 0

    @score_max = 999999999

    @score_sprite = Sprite.new

    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)

  end

  #--------------------------------------------------------------------------

  # please leave this alone if you don't know what you're doing

  def draw_sprite(sprite, type)

    case type

    when 0

    end

  end

  #--------------------------------------------------------------------------

  def main

    Graphics.transition

    until $scene != self

      Input.update

      Graphics.update

      update

    end

    Graphics.freeze

    @sprite.dispose

    @hole_sprite.dispose

  end

  #--------------------------------------------------------------------------

  def update

    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360 # ADD

    # transparency handler

    if Input.press?(Input::A)

      @sprite.opacity -= 2 unless @sprite.opacity <= 128

    else

      @sprite.opacity += 2 unless @sprite.opacity == 255

    end

    # boost handler

    if Input.press?(Input::X)

      if @sprite.opacity == 255

        @current_speed += 1 unless @current_speed == @speed[1]

      else

        @current_speed -= 1 unless @current_speed == @speed[0]

      end

    else

      @current_speed -= 1 unless @current_speed == @speed[0]

    end

    speed = @current_speed

    # exit handlers

    if Input.press?(Input::C) || Input.press?(Input::B)

      $scene = nil

    end

    # movement handlers

    if Input.press?(Input::LEFT)

      @sprite.x -= speed

      @sprite.x = 0 if @sprite.x < 0

    end

    if Input.press?(Input::DOWN)

      @sprite.y += speed

      @sprite.y = 448 if @sprite.y > 448

    end

    if Input.press?(Input::UP)

      @sprite.y -= speed

      @sprite.y = 0 if @sprite.y < 0

    end

    if Input.press?(Input::RIGHT)

      @sprite.x += speed

      @sprite.x = 608 if @sprite.x > 608

    end

    # sprite's visuals handler

    if @current_speed == @speed[0]

      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))

    elsif @current_speed == @speed[1]

      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))

    end

    # handles collision with hole

    if collision_between?(@sprite, @hole_sprite)

      @score += 1

      @hole_sprite.x = rand(608)

      @hole_sprite.y = rand(448)

      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0

      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]

    end

  end

  #--------------------------------------------------------------------------

  def collision_between?(object1, object2, size=[32, 32])

    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&

        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40) # MOD

      return true

    end

    return false

  end

  #--------------------------------------------------------------------------

end
 

MicKo

Member

Submission
[ruby]# Based on: Script by Zeriab
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  NORMAL_SPEED = 9
  BOOST_SPEED = 27
  #--------------------------------------------------------------------------
  def initialize(level = 1) # MOD
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(72, 120, 0)) # MOD
    @hole_sprite.ox = @hole_sprite.bitmap.width / 2
    @hole_sprite.oy = @hole_sprite.bitmap.height / 2
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0
    @score_max = (level ** 1.5 * 20).to_i # MOD
    @score_sprite = Sprite.new
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)
    @score_sprite.x = 10 # ADD
    @score_sprite.z = @sprite.z + 1 # ADD
    @score_sprite.bitmap.draw_text(0,0,
    "Score: #{@score}".size * Font.default_size, 40, @score.to_s, 0) # ADD
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @score += 1
      @score_sprite.bitmap.clear # ADD
      @score_sprite.bitmap.draw_text(0,0,
      "Score: #{@score}".size * Font.default_size, 40, @score.to_s, 0) # ADD
      @hole_sprite.x = rand(608)
      @hole_sprite.y = rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&
        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 
Submission
[ruby]# Based on: Script by MicKo
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  # MOD x2 - two lines removed
  #--------------------------------------------------------------------------
  def initialize(level = 1)
    @level = level
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(72, 120, 0))
    @hole_sprite.ox = @hole_sprite.bitmap.width / 2
    @hole_sprite.oy = @hole_sprite.bitmap.height / 2
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0
    @score_max = (level ** 1.5 * 20).to_i
    @score_sprite = Sprite.new
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)
    @score_sprite.x = 10
    @score_sprite.z = @sprite.z + 1
    @score_sprite.bitmap.draw_text(0,0,
    "Score: #{@score}".size * Font.default_size, 40, @score.to_s, 0)
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP) # ADD
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT) # ADD
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT) # ADD
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP) # ADD
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @score += 1
      @score_sprite.bitmap.clear
      @score_sprite.bitmap.draw_text(0, 0, "Score: #{@score}".size * Font.default_size, 40, @score.to_s, 0)
      @hole_sprite.x = 16 + rand(608) # MOD
      @hole_sprite.y = rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&
        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 

MicKo

Member

Submission
[ruby]# Based on: Script by BlueScope
# Changes: 5 of 5 lines added, 3 of 3 lines modified
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  def initialize(level = 1)
    @level = level
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(72, 120, 0))
    @hole_sprite.ox = @hole_sprite.bitmap.width / 2
    @hole_sprite.oy = @hole_sprite.bitmap.height / 2
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0
    @score_max = (level ** 1.5 * 20).to_i
    @score_sprite = Sprite.new
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)    @score_sprite.x = 10
    @score_sprite.z = @sprite.z + 1
    @score_sprite.bitmap.draw_text(0,0,
    "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0) # MOD
    @hole_timer = 10 - (level - 1) * 0.1 # ADD
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
    @score_sprite.dispose # ADD
  end
  #--------------------------------------------------------------------------
  def update
    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @score += 1
      @score_sprite.bitmap.clear
      @score_sprite.bitmap.draw_text(0, 0,
      "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0) # MOD
      @hole_sprite.x = 16 + rand(608)
      @hole_sprite.y = 16 + rand(448) # MOD
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]
      $scene = Scene_OurScene.new(@level + 1) if @score >= @score_max # ADD
    end
    if @hole_timer < 0 # ADD
    end # ADD
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&
        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 
It's getting quiet in here... only mindlessly working scripting labrats, doing there work for Zeriab, who intelligently made people fill his request... DAMN YOU, ZERIAB!
:tongue:

Submission
[ruby]# Based on: Script by MicKo
# Changes: 5 of 5 lines added, 0 of 3 lines modified
 
class Bitmap # ADD
  #--------------------------------------------------------------------------
  # credit for this goes to Trickster, as it's taken from the MACL
  def draw_circle(x, y, radius, color = Color.new(255, 255, 255, 255)) # ADD
    hooboo = "I am a line to be replaced" # ADD
  end # ADD
  #-------------------------------------------------------------------------
end # ADD
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  def initialize(level = 1)
    @level = level
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(72, 120, 0))
    @hole_sprite.ox = @hole_sprite.bitmap.width / 2
    @hole_sprite.oy = @hole_sprite.bitmap.height / 2
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0
    @score_max = (level ** 1.5 * 20).to_i
    @score_sprite = Sprite.new
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)
    @score_sprite.x = 10
    @score_sprite.z = @sprite.z + 1
    @score_sprite.bitmap.draw_text(0,0,
    "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0)
    @hole_timer = 10 - (level - 1) * 0.1
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
    @score_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @score += 1
      @score_sprite.bitmap.clear
      @score_sprite.bitmap.draw_text(0, 0, "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0)
      @hole_sprite.x = 16 + rand(608)
      @hole_sprite.y = 16 + rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]
      $scene = Scene_OurScene.new(@level + 1) if @score >= @score_max
    end
    if @hole_timer < 0
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&
        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
 

MicKo

Member

Submission
[ruby]# Based on: Script by BlueScope
# Changes: 5 of 5 lines added, 1 of 3 lines modified
 
class Bitmap
  #--------------------------------------------------------------------------
  # credit for this goes to Trickster, as it's taken from the MACL
  def draw_circle(x, y, radius, color = Color.new(255, 255, 255, 255))
    hooboo = "I am a line to be replaced"
  end
  #-------------------------------------------------------------------------
end
 
class Scene_OurScene
  #--------------------------------------------------------------------------
  def initialize(level = 1)
    @level = level
    @sprite = Sprite.new
    @sprite.x = 304
    @sprite.y = 224
    @sprite.bitmap = Bitmap.new(32, 32)
    @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    @hole_sprite = Sprite.new
    @hole_sprite.x = 484
    @hole_sprite.y = 89
    @hole_sprite.bitmap = Bitmap.new(32, 32)
    @hole_sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(72, 120, 0))
    @hole_sprite.ox = @hole_sprite.bitmap.width / 2
    @hole_sprite.oy = @hole_sprite.bitmap.height / 2
    @hole_sprite.z = @sprite.z - 1
    @speed = [9, 27]
    @current_speed = @speed[0]
    @score = 0
    @score_max = (level ** 1.5 * 20).to_i
    @score_sprite = Sprite.new
    @score_sprite.bitmap = Bitmap.new("Score: #{@score_max}".size * Font.default_size, 40)
    @score_sprite.x = 10
    @score_sprite.bitmap.draw_text(0,0,
    "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0)
    @hole_timer = 10 - (level - 1) * 0.1
    @timer_sprite = Sprite.new # ADD
    @timer_sprite.x = 630 - @hole_timer.to_s.size * Font.default_size # ADD
    @timer_sprite.y = @score_sprite.y = 5 # ADD
    @timer_sprite.z = @score_sprite.z = @sprite.z + 1 # MOD (@score_sprite.z = @sprite.z + 1)
    @timer_sprite.bitmap = Bitmap.new("Time: #{@hole_timer.to_i}".size * Font.default_size, 40) # ADD
  end
  #--------------------------------------------------------------------------
  # please leave this alone if you don't know what you're doing
  def draw_sprite(sprite, type)
    case type
    when 0
    end
  end
  #--------------------------------------------------------------------------
  def main
    Graphics.transition
    until $scene != self
      Input.update
      Graphics.update
      update
    end
    Graphics.freeze
    @sprite.dispose
    @hole_sprite.dispose
    @score_sprite.dispose
  end
  #--------------------------------------------------------------------------
  def update
    @hole_timer -= 1 if Graphics.frame_count % Graphics.frame_rate == 0 # ADD
    @hole_sprite.angle = (@hole_sprite.angle + 2) % 360
    # transparency handler
    if Input.press?(Input::A)
      @sprite.opacity -= 2 unless @sprite.opacity <= 128
    else
      @sprite.opacity += 2 unless @sprite.opacity == 255
    end
    # boost handler
    if Input.press?(Input::X)
      if @sprite.opacity == 255
        @current_speed += 1 unless @current_speed == @speed[1]
      else
        @current_speed -= 1 unless @current_speed == @speed[0]
      end
    else
      @current_speed -= 1 unless @current_speed == @speed[0]
    end
    speed = @current_speed
    # exit handlers
    if Input.press?(Input::C) || Input.press?(Input::B)
      $scene = nil
    end
    # movement handlers
    if Input.press?(Input::LEFT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x -= speed
      @sprite.x = 0 if @sprite.x < 0
    end
    if Input.press?(Input::DOWN)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y += speed
      @sprite.y = 448 if @sprite.y > 448
    end
    if Input.press?(Input::UP)
      speed /= 1.4 if Input.press?(Input::LEFT) or Input.press?(Input::RIGHT)
      @sprite.y -= speed
      @sprite.y = 0 if @sprite.y < 0
    end
    if Input.press?(Input::RIGHT)
      speed /= 1.4 if Input.press?(Input::DOWN) or Input.press?(Input::UP)
      @sprite.x += speed
      @sprite.x = 608 if @sprite.x > 608
    end
    # sprite's visuals handler
    if @current_speed == @speed[0]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196, 196, 196))
    elsif @current_speed == @speed[1]
      @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 128, 0))
    end
    # handles collision with hole
    if collision_between?(@sprite, @hole_sprite)
      @score += 1
      @score_sprite.bitmap.clear
      @score_sprite.bitmap.draw_text(0, 0, "Score: #{@score_max}".size * Font.default_size, 40, "Score: #{@score}", 0)
      @hole_sprite.x = 16 + rand(608)
      @hole_sprite.y = 16 + rand(448)
      @speed[1] -= 1 if @speed[1] > @speed[0] + 1 && @score % 5 == 0
      @current_speed = @current_speed > @speed[0] ? @speed[1] : @speed[0]
      $scene = Scene_OurScene.new(@level + 1) if @score >= @score_max
    end
    if @hole_timer < 0
    end
  end
  #--------------------------------------------------------------------------
  def collision_between?(object1, object2, size=[32, 32])
    if (object1.x + size[0]).between?(object2.x - 8, object2.x + 40) &&
        (object1.y + size[1]).between?(object2.y - 8, object2.y + 40)
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
end
[/ruby]
I guess I missed your last submission. :p
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top