마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

간단한 클리커 게임 개발중인데요!

0 추천
안녕하세요
간단하게 클리커 게임 개발중인데


        <RelativeLayout
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:onClick="onClick"
            android:clickable="true"
            android:id="@+id/target">

            <ImageView
                android:layout_height="150dp"
                android:layout_width="100dp"
                android:src="@drawable/monster_01"
                android:clickable="true"
                android:layout_centerInParent="true"
                android:id="@+id/monster"/>

            <TextView
                android:id="@+id/hp"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="#FF0000"
                android:layout_below="@id/monster"
                android:layout_centerInParent="true"
                android:layout_marginTop="35dp"/>

            <ProgressBar
                style="?android:attr/progressBarStyleHorizontal"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:progress="0"
                android:max="1000"
                android:id="@+id/fever"
                android:layout_alignParentRight="true"
                android:layout_alignParentBottom="true"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"/>

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="0"
                android:textSize="15sp"
                android:visibility="gone"
                android:layout_above="@id/monster"
                android:layout_centerInParent="true"
                android:id="@+id/hit_damage"
                android:layout_marginBottom="10dp"
                android:gravity="center"
                android:textColor="#000000"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:text="0"
                android:textSize="15sp"
                android:visibility="gone"
                android:layout_above="@id/monster"
                android:layout_centerInParent="true"
                android:layout_marginBottom="20dp"
                android:gravity="center"
                android:textColor="#3141D2"
                android:id="@+id/hit_plusdamage"/>

        </RelativeLayout>

모바일이라서 그런지 소스코드 올리는게 없네요..
아무튼 저렇게 지금 설정을 해두었는데요.

RelativeLayout이 클릭될 시 체력이 데미지만큼 떨어지게 구현을 한상태입니다.

현재 지정된 몬스터가 죽고 나면 체력&이미지를 갈아주고 클릭 > 맞는처리 까지 해주어야 하는 상태인데 이걸 어떻게 해야 할지좀 가르쳐 주시면 감사하겠습니다..

검색어를 뭐라고 쳐야할지도 모르겠고 답답 하네요  ㅠㅠ
PE POCKET STORE (120 포인트) 님이 2018년 8월 19일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...