Guest Access
Register:
New Account
Play Along
General Chat
All About Games
Public Polls
Writings
Graphics
Sounds
Scripts
Projects
Inspiration:
Contact Forum
Community:
Creations:
Inspiration:









G@MeF@Ce
![]() | ||
CD3DF5

what vids are you talking about?is there a script that you are currently using, editing, trying to make?
maybe we can break down a few lines with comments to understand/learn some more... ?
Super Mockup Project
Cool Puzzle Cave
Into the Nexas
Web_Plat
Getroid
G.A.S.
G101's theme colors



handy333

I'm working on a padlock system for my one of my training project games here's the code:- Code:
class Pad
def initialize(com, angle = 0)
$angle = angle
@com = com
@times = -1
@combo = []
@close = false
main
end
def main
@show = Viewport.new(0, 0, 640, 480)
@show.z = 3
@back = Sprite.new(@show)
@back.bitmap = RPG::Cache.picture("Lock-back")
@back.x = 87
@back.y = 7
@mid= Sprite.new(@show)
@mid.bitmap = RPG::Cache.picture("Lock-Dial")
@mid.x = 320
@mid.y = 240
@mid.ox = 150.5
@mid.oy = 152
@glint = Sprite.new(@show)
@glint.bitmap = RPG::Cache.picture("Lock-Glint")
@glint.x = 319
@glint.y = 176
@glint.opacity = 150
@stats_window = Results.new
@stats_window.back_opacity = 130
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if @close == true
break
end
end
@back.dispose
@mid.dispose
@glint.dispose
@stats_window.dispose
end
def update
@back.update
@mid.update
@glint.update
if Input.press?(Input::LEFT)
$angle = @mid.angle += 1.to_i
Audio.se_play("Audio/SE/032-Switch01", 70, 0) rescue nil
if @mid.angle >= 1
@mid.angle = 0
Audio.se_stop
end
end
if Input.press?(Input::RIGHT)
$angle = @mid.angle += -1.to_i
Audio.se_play("Audio/SE/032-Switch01", 70, 0) rescue nil
if @mid.angle <= -319
@mid.angle = -318
Audio.se_stop
end
end
if Input.trigger?(Input::R)
$angle = @mid.angle += -50
Audio.se_play("Audio/SE/032-Switch01", 70, 0) rescue nil
if @mid.angle <= -318
@mid.angle = -318
$angle = -318
end
end
if Input.trigger?(Input::L)
@angle = @mid.angle += 50
Audio.se_play("Audio/SE/032-Switch01", 70, 0) rescue nil
if @mid.angle >= 1
@mid.angle = 0
@angle = 0
end
end
if Input.trigger?(Input::B)
@back.dispose
@mid.dispose
@glint.dispose
@close = true
end
if Input.trigger?(Input::C)
p @angle
ini = @angle.to_a
@times += 1
if @times == 2
@times = 0
if @com == @combo
p "Got it!"
Audio.se_play("Audio/SE/054-Right01", 70, -100) rescue nil
@back.dispose
@mid.dispose
@glint.dispose
@close = true
else
Audio.se_play("Audio/SE/057-Wrong01", 70, -100) rescue nil
@combo.clear
end
end
case @times
when 0
@combo += ini
p @combo
when 1
@combo += ini
p @combo
when 2
@combo += ini
p @combo
end
end
end
end
class Results < Window_Base
def initialize
super(0, 0, 130, 130)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 130, 130,"")
end
end
There are probably millions of things wrong with this but I got what I needed to work, now what I'm trying to do is make the coordinates display on a window so the player could see what they inputed.
















































