LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : Previous  1, 2, 3, 4

View previous topic View next topic Go down Message [Page 4 of 4]

Active Member
Active Member
#31 Ruby/RGSS Lessons - Page 4 Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
It's kind of hard to follow the vids when he's only using RMVX or higher. That's why I'm sort of confused on all of the topics.

Noob, nerd, or geek aren't a set of my favorite words...
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
Administrator
Administrator
#32 Ruby/RGSS Lessons - Page 4 Empty Re: Ruby/RGSS Lessons
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
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... ?
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#33 Ruby/RGSS Lessons - Page 4 Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
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.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
EVENTALIST
EVENTALIST
#34 Ruby/RGSS Lessons - Page 4 Empty Re: Ruby/RGSS Lessons
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Handy, do you still need help with this? It's been a while since i've had internet.

Also noob is just a word, when i programed my first window it was the title of the window class i chose because it seemed fitting. Much like 'Hello world' to me words dont have meaning unlesss you put meaning behind them. But much like that meaning influences emotions it can also be a driving force to learn. Smile

I think i'll try to include 'noob' somewhere in my next script title, because why not? A_Noob_Made_Extractor.

But serriously, dont be afraid to ask questions if you still have any. Smile
EVENTALIST
Show Signature
EVENTALIST

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 4 of 4]

Go to page : Previous  1, 2, 3, 4

 

Chatbox system disabled
Personal messaging disabled