728x90
반응형

전체 글 61

webViewWithEditText in Android Studio

WebViewWithEditText https://yunseong.tistory.com/entry/Android-App-Study2-sharedPreferences-webView-Navigation Android App Study_2 (sharedPreferences, webView, Navigation) 1. SharedPreferences https://youtu.be/-2QPmS4OWos SharedPreferences는 앱을 끄고 다시 키더라고 정보가 남아있도록 정보를 저장할 수 있는 것이다. 이것을 사용하는 방법은 1 2 3 4 SharedPreferences shared.. yunseong.tistory.com 위 페이지에서 만든 webView에다가 EditText를 이용해서 URL 입력 창을..

Android App 2021.08.02

지뢰찾기 by Python

Python으로 지뢰찾기를 만들게 된 이유는 지뢰찾기 판을 자동으로 만드는 과제를 받았는데 그것을 실제로 게임이 되게 하면 재미있겠다 생각해서 이다. 파이썬으로 그래픽을 만지는 법을 모르기에 오직 텍스트로만 만들었다. 게임판의 토대 만들기 지뢰찾기를 만들기 위해서는 게임판을 먼저 만들어야 한다. 플레이어에게 보이는 게임판과 지뢰의 위치가 그려져있는 게임판을 따로 만들어줬다. 1 2 3 4 5 6 7 8 9 gameBoard = [] vGameBoard = [] #visible Game board mode = 'O' # O : open mode , F : flag mode for raw in range(10): gameBoard.append(['.']*10) for raw in range(11): vGam..

Text Graphic Game 2021.07.24

sharedPreferences, webView, Navigation in Android Studio

1. SharedPreferences https://youtu.be/-2QPmS4OWos SharedPreferences는 앱을 끄고 다시 키더라고 정보가 남아있도록 정보를 저장할 수 있는 것이다. 이것을 사용하는 방법은 1 2 3 4 5 6 SharedPreferences sharedPreferences = getSharedPreferences(String fileName, 0); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("mandu", value); editor.commit; Colored by Color Scripter cs 위와 같이 SharedPreferences를 getSharedPreference..

Android App 2021.07.19

회복 아이템 by Unity

회복 아이템을 구현하기 위해서 아이템 오브젝트의 c# component에서 구현하려고 했으나 player가 닿아서 먹는다면 item은 없어질 것이고 그러면 그 후에 지속적으로 회복을 시켜줄 수 없고 중첩에 대해서도 복잡해지기에 player의 c# component에서 대부분의 기능을 구현했다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 int HealTime = 0; public void Healed(int HealTime) { if (this.HealTime > 0) { this.HealTime += HealTime; } else if (this.HealTime

Unity/2D RPG 2021.07.18

캐릭터(슬라임) by Unity

슬라임 타입의 적이 텍스쳐를 그리기에도 쉽기에 슬라임 타입의 적을 만들기로 했다. 먼저 슬라임은 기본적으로 계속 점프를 하고 player을 발견하면 더 높고 빠르게 뛰도록 할 것이다. 1 2 3 4 5 6 7 8 9 10 11 12 13 int Direction = 0; Vector2 pos = new Vector2(transform.position.x, transform.position.y); Vector2 boxSize = new Vector2(10.0f, 10.0f); Collider2D[] collider2Ds = Physics2D.OverlapBoxAll(pos, boxSize, 0); foreach (Collider2D collider in collider2Ds) { if (collider.t..

Unity/2D RPG 2021.07.18

원거리 공격 by Unity

포물선을 그리면서 날아가는 투사체를 이용해서 공격하는 것을 만들 것이다. 투사체를 윗 방향으로 던진다면 거리가 있는 곳에 있는 적은 맞추기 쉽겠지만 가깝게 있는 작은 적은 맞추기 어려울 것이다. 그렇기 때문에 앞쪽으로 던지고 아래쪽으로 중력을 가해서 포물선을 그리며 투사체가 날아가도록 했다. 그러기 위해서는 먼저 투사체 객체에 대한 코딩을 먼저 해야 한다. 1 2 3 4 void Start() { this.GetComponent().velocity = new Vector2(Velocity_x * Direction , 0); } Colored by Color Scripter cs player 이 보고 있는 방향을 1, -1로 Direction으로 들고 와서 투사체의 속도를 변경해줬다. 그리고 속도는 처음 ..

Unity/2D RPG 2021.07.14

Fragment 전환, layout, activity 전환 in Android Studio

1. 네비게이션 메뉴 바 https://www.youtube.com/watch?v=stwCk_f3sCw 화면 하단의 네비게이션 바와 fragment를 이용해서 여러 앱에서 볼 수 있는 앱의 구조를 만들 수 있었다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 BottomNavigationView bottomNavigationView; bottomNavigationView = findViewById(R.id.NavigationId); bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListene..

Android App 2021.07.13

카메라 무빙 by Unity

player와 카메라의 좌표를 일대일 대응시킨다면 편하겠지만 그렇게 자연스럽지 않을 것이다. 그렇기에 나는 카메라 중심에서 어느정도 떨어졌고 더 떨어지는 방향으로 이동할 때에만 카메라와 player의 위치를 일대일 대응시켰다. 카메라의 position이 Vector3 변수인 camera.position에 player의 position이 Vector3 변수인 player.position에 저장되있고 각각의 velociry를 각각의 .velocity에 저장되있다고 하면 1 2 3 4 5 if (camera.position.x - player.position.x >= 3 && player.velocity.x = 3 && player.velocity.y

Unity/2D RPG 2021.07.08

근접 공격 by Unity

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Rigidbody rigid2D; Animator animator; public int damage = 5; private float curTime; public float coolTime = 0.5f; // 공격 쿨타임 void Attack() //공격 { this.animator.SetTrigger("attacking"); curTime = coolTime; StartCoroutine("Attacking"); //Coroutine for 애니메이션의 타격시간과 실질 데미지가 다는 시간을 동일하게 하기 위해..

Unity/2D RPG 2021.07.07
728x90
반응형