| 赞 | 3 |
| VIP | |
| 好人卡 | |
| 积分 | 5 |
| 经验 | |
| 最后登录 | 2026-6-9 |
| 在线时间 | 1554 小时 |
永无止境的旅程<
- 梦石
- 0
- 星屑
- 537
- 在线时间
- 1554 小时
- 注册时间
- 2012-6-19
- 回帖
- 1162
 
|
发表于 2015-10-5 00:58:13
|
显示全部楼层
本帖最后由 丿梁丶小柒 于 2015-10-5 15:01 编辑
游戏一:扳手腕[pre lang="ruby"]#---------------------------------------------------------------------
# RMVX 扳手腕游戏 使用$scene = Scene_Wrestling.new 调用
#---------------------------------------------------------------------
class Scene_Wrestling < Scene_Base
def initialize
wenzi
@wenzi2 = Sprite.new()
@wenzi2.bitmap = Bitmap.new(200,30)
@wenzi2.bitmap.draw_text(Rect.new(0,0,200,20),"按Z开始",1)
@wenzi2.x = Graphics.width / 2 - 100
@wenzi2.y = Graphics.height / 2 - 50
@wenzi3 = Sprite.new()
@wenzi3.bitmap = Bitmap.new(300,30)
@wenzi3.bitmap.draw_text(Rect.new(0,0,300,20),"游戏说明:连击Z按键即可~!禁止ENTER键~",1)
@wenzi3.x = Graphics.width / 2 - 150
@wenzi3.y = Graphics.height / 2 + 50
@viewport1 = Viewport.new(Graphics.width / 2 - 200, Graphics.height / 2 - 15, 400, 30)
@viewport1.color.set(255, 25, 25, 255)
@viewport2 = Viewport.new(Graphics.width / 2 - 10, Graphics.height / 2 - 15, 20, 30)
@viewport2.color.set(255, 255, 255, 255)
@kaishi = false
@num = 1
@num1 = 0
end
def wenzi(i = 1)
@wenzi = Sprite.new()
@wenzi.bitmap = Bitmap.new(250,30)
@wenzi.bitmap.draw_text(Rect.new(0,0,250,20),"第一届扳手腕游戏~第"+i.to_s+"关",1) if i < 5
@wenzi.bitmap.draw_text(Rect.new(0,0,250,20),"第一届扳手腕游戏~最后一关~!",1) if i == 5
@wenzi.x = Graphics.width / 2 - 125
@wenzi.y = Graphics.height / 2 - 80
end
def update
if Input.trigger?(Input::C)
@kaishi = true
@viewport2.rect.x += 20-@num*1.5
end
@num1 += 1
@viewport2.rect.x -= 2 if @num1%2 == 0 && @kaishi == true
if @viewport2.rect.x >= Graphics.width / 2 - 10 +200 && @num <= 4
@num1 = 0
@kaishi = false
p "恭喜你赢了~!按确定挑战下一关~~~!" if @num < 4
p "恭喜你赢了~!按确定挑战最后关~~~!" if @num == 4
@wenzi.dispose
@num += 1
wenzi(@num)
@viewport2.rect.x = Graphics.width / 2 - 10
@kaishi = false
elsif @viewport2.rect.x >= Graphics.width / 2 - 10 +200 && @num == 5
p "恭喜你获得了第一届扳手腕游戏冠军~!"
@num += 1
end
p "很遗憾~你输了~~!" if @viewport2.rect.x <= Graphics.width / 2 - 10 -200
exit if @viewport2.rect.x <= Graphics.width / 2 - 10 -200 || @num == 6
end
end
[/pre]
游戏二:来打我丫
[pre lang="ruby"]#---------------------------------------------------------------------
# RMVX 《来打我丫》 使用$scene = Scene_Game.new 调用
#---------------------------------------------------------------------
class Scene_Game < Scene_Base
def initialize
@wenzi1 = Sprite.new()
@wenzi1.bitmap = Bitmap.new(200,30)
@wenzi1.bitmap.draw_text(Rect.new(0,0,200,20),"快按Z攻击BOSS",1)
@wenzi1.x = Graphics.width / 2 - 100
@wenzi1.y = Graphics.height / 2
@wenzi2 = Sprite.new()
@wenzi2.bitmap = Bitmap.new(200,30)
@wenzi2.bitmap.draw_text(Rect.new(0,0,200,20),"来打我丫~~!!",1)
@wenzi2.x = Graphics.width / 2 + 10
@wenzi2.y = Graphics.height / 2 - 150
@viewport1 = Viewport.new(Graphics.width / 2 - 50, Graphics.height / 2 - 100, 100, 80)
@viewport2 = Viewport.new(Graphics.width / 2 - 40, Graphics.height / 2 - 80, 10, 10)
@viewport3 = Viewport.new(Graphics.width / 2 + 30, Graphics.height / 2 - 80, 10, 10)
@viewport4 = Viewport.new(Graphics.width / 2 -10, Graphics.height / 2 - 40, 30, 6)
@viewport1.color.set(255, 255, 255, 255)
@viewport2.color.set(0, 0, 0, 255)
@viewport3.color.set(0, 0, 0, 255)
@viewport4.color.set(0, 0, 0, 255)
@viewport5 = Viewport.new(Graphics.width / 2 - 200, Graphics.height / 2 + 50, 400, 30)
@viewport5.color.set(255, 25, 25, 255)
@viewport6 = Viewport.new(Graphics.width / 2 - 20, Graphics.height / 2 + 50, 40, 30)
@viewport6.color.set(255, 255, 0, 255)
@viewport7 = Viewport.new(Graphics.width / 2 - 10, Graphics.height / 2 + 50, 20, 30)
@viewport7.color.set(255, 255, 255, 255)
@viewport8 = Viewport.new(Graphics.width / 2 + 70, Graphics.height / 2 - 100, 20, 80)
@viewport8.color.set(255, 25, 25, 255)
@time = 0
@RL = true
end
def pop(i = 1)
@pop_txt = Sprite.new()
@pop_txt.bitmap = Bitmap.new(200,30)
@pop_txt.bitmap.draw_text(Rect.new(0,0,200,20),i.to_s,1)
@pop_txt.x = Graphics.width / 2 - 100
@pop_txt.y = Graphics.height / 2 - 120
end
def update
@time += 1
@pop_txt.y -= 1 if @pop_txt != nil
if @pop_txt != nil && @pop_txt.y < Graphics.height / 2 - 150
@pop_txt.dispose
@pop_txt = nil
end
@RL = true if @viewport7.rect.x <= Graphics.width / 2 - 200 - 10
@RL = false if @viewport7.rect.x >= Graphics.width / 2 + 200 - 10
@viewport7.rect.x += 10 if @RL == true
@viewport7.rect.x -= 10 if @RL == false
if Input.trigger?(Input::C)
@pop_txt.dispose if @pop_txt != nil
@pop_txt = nil if @pop_txt != nil
i = rand(20)
i = rand(30)+20 if @viewport7.rect.x > Graphics.width / 2 - 20 && @viewport7.rect.x < Graphics.width / 2 + 20
pop(i)
@viewport8.rect.height -= i / 10
@viewport8.rect.y += i / 10
if @viewport8.rect.height <= 0
p "你使用了 "+(@time/60).to_s+"秒 的时间攻略的BOSS~!"
p "恭喜通关~~!!"
exit
end
end
end
end[/pre] |
|