질문과 답변

Extra Form

  def param_update
    @hp.set_rect(hp_rate,@hp.height)
      if player.hp.to_f / player.mhp = <0.5>0.25
        def normal_tone

        Tone.new(255,0,0,255)

      end
       
        else
          if player.hp.to_f / player.mhp = <0.26>0.0
            def normal_tone

            Tone.new(255,-255,0,255)

          end
         
            else
         
              def normal_tone

                Tone.new(0,0,0,255)

              end
       
       
    @mp.set_rect(mp_rate,@mp.height)
    @exp.set_rect(exp_rate,@exp.height)
    [@hp,@mp,@exp].each {|i| i.update }
  end


이렇게 작성을 했는데 부등호를 인식을 못하는것 같은데 어떻게 해야 플레이어의 hp가 0.26보다 작을때를 나타낼수 있을까요?

Who's 게임잘날아가는닝겐

profile

와 도망쳐 ccc 파일들이야

Comment '2'
  • ?
    Alkaid 2015.09.19 17:24
    변수 =< 수치 1 > 수치 2가 루비에서 허용되는 형태인가요?
    if 변수 =< 수치 1 and 변수 > 수치 2 식으로 해야 하지 않을까요?
  • profile
    게임잘날아가는닝겐 2015.09.20 18:27

    if문 들어가 있습니다만...


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12442
Board Pagination Prev 1 ... 19 Next
/ 19