no image
[고1 프로그래밍] 09 - (4)
class Monster: def __init__(self, name, age): self.name = name self.age = age def say(self): print(f"나는 {self.name}이고 {self.age}살이다.") shark = Monster("상어", 7) wolf = Monster("늑대", 5) dog = Monster("강아지", 3) cat = Monster("고양이", 1) shark.say() wolf.say() dog.say() cat.say() # 마린 : 공격 유닛, 군인, 총을 쏠 수 있음. name = "마린" hp = 40 damage = 5 print("{0} 유닛이 생성되었습니다.".format(name)) print("체력 {0}, 공격력 {1}\n..
2023.09.20
no image
[고1 게임엔진] 09 - (5)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Move : MonoBehaviour { // Time.deltaTime : Update() 메서드가 한번 호출되고 다시 호출되기까지 걸린시간을 의미 public float speed = 5; float h; // 좌우방향키 입력값 float v; // 상하방향키 입력값 Vector2 dir; void Start() { } // 고성능pc - Time.deltaTime 값이 매우 작은 값이 된다 // 저성능pc - Time.deltaTime 값이 매우 커지게 된다 // Time.deltaTime을 이용해서 성능차이가 있는 기기일지라도 같은 시..
2023.09.20
no image
[고1 화면구현] 09 - (3)
박스 모델 margin 30px, padding 20px, border 5px의 빨간색 점선 다양한 테두리 3픽셀 solid 3픽셀 none 3픽셀 hidden 3픽셀 dotted 3픽셀 dashed 3픽셀 double 15픽셀 groove 15픽셀 ridge 15픽셀 inset 15픽셀 outset 둥근 모서리 테두리 반지름이 50픽셀의 둥근 모서리 반지름 0, 20, 40, 60 둥근 모서리 반지름 0, 20, 40, 20 둥근 모서리 반지름 0, 20, 0, 20 둥근 모서리 반지름 50의 둥근 점선 모서리
2023.09.19
no image
[고1 게임엔진] 09 - (4)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Forever_Chase : MonoBehaviour { // 유령이 플레이어을 계속 쫓아다닌다. // 목표오브젝트(타겟-boy) Rigidbody2D rb; GameObject targetObject; // 타겟오브젝트를 찾기위한 변수선언 public float speed = 5; // 유령의 이동속도 public string targetObjectName; // 목표오브젝트에 이름 저장 public string showObjectName; // 표시할오브젝트 이름 저장(햄버거) GameObject showObject; // 표시할 오브젝트..
2023.09.18
no image
[고1 프로그래밍] 09 - (3)
import pickle profile3_file = open("profile3.pickle", "wb") profile3 = {"이름":"박명수", "나이":30, "취미":["축구", "골프", "코딩"]} print(profile3) pickle.dump(profile3, profile3_file) profile3_file.close() # import pickle # profile3_file = open("profile3.pickle", "rb") # profile3 = pickle.load(profile3_file) # print(profile3) # profile3_file.close() import pickle with open("profile3.pickle", "rb") as profile..
2023.09.18
no image
[고1 수학] 2학기 1차 지필평가
원과 직선의 위치 관계 원 $x^2+y^2=r^2$에 접하고 기울기가 $m$인 접선의 방정식은 $y=mx±r\sqrt{m^2+1}$ 원 $x^2+y^2=r^2$ 위의 점 $(x₁, y₁)$에서의 접선의 방정식은 $x₁x+y₁y=r^2$ 평행이동 방정식 $f(x, y)=0$이 나타내는 도형을 x축의 방향으로 a만큼, y축의 방향으로 b만큼 평행이동한 도형의 방정식은 $f(x-a, y-b)=0$ 대칭이동 x축 대칭 (x, -y) y축 대칭 (-x, y) 원점 대칭 (-x, -y) 직선 y=x 대칭 (y, x) 집합 집합 기준에 따라 대상을 분명히 정할 수 있을 때, 그 대상들의 모임 원소 집합을 이루는 대상 하나하나 a∈A a가 집합 A의 원소일 때 100 이하의 홀수의 집합을 A라 할 때, A = {1, ..
2023.09.17
no image
[고1 화면구현] 09 - (2)
Consolas font font-weight 900 font-weight 100 Italic Style Oblique Style 현재 크기의 1.5배 크기로 DIVDIVDIV
2023.09.14
no image
[고1 프로그래밍] 09 - (2)
file = open("newfile.txt","w",encoding="utf-8") for i in range(1,11): data = "%d번째 입니다\n" % i file.write(data) # data를 파일객체(file)에 써라 file.close() file = open("newfile.txt","r",encoding="utf-8") line = file.readline() print(line) file.close() file = open("newfile.txt", "r", encoding="utf-8") while True: line = file.readline() if not line: break print(line, end="") file.close() file = open("newfi..
2023.09.13
no image
[고1 게임엔진] 09 - (3)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Forever_Chase : MonoBehaviour { // (유령이) 플레이어를 계속 추적한다(Chase) public float speed = 3; // 유령의 이동속도 public string targetObjectName; // 목표 오브젝트의 이름 저장 // 리지드바디컴포넌트형 변수선언(클래스명 변수명 = new 클래스명()) Rigidbody2D rb; // 게임오브젝트형 변수선언 GameObject targetObject; void Start() { rb = GetComponent(); rb.gravityScale = 0; rb..
2023.09.13