Skip to content

Commit

Permalink
노이즈 2 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MineEric64 committed Sep 4, 2023
1 parent 29b722e commit f12c225
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
2 changes: 0 additions & 2 deletions components/events/noise.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pygame
import numpy as np

import time

from components.config import CONFIG, debug

class NoiseEvent:
Expand Down
Binary file added docs/images/noise_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/noise_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/noise_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/noise_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/submission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
|[설정](./settings.md)|메인 메뉴나 인게임에서 적용할 수 있는 설정 화면|
|[ESC 화면](./pause_menu.md)|인게임에서 ESC를 눌렀을 때 나오는 일시정지 화면|
|[동적 텍스트 애니메이션](./dynamic_text_animation.md)|NPC와 대화하는 기능을 구현하기 위한 텍스트 애니메이션|
|[노이즈](./noise.md)|체력이 부족하거나 시간을 되돌릴 때 이를 시각화|
|[시간 관리](./time.md)|시간을 되돌리는 기능|
|[중력 & 점프](./gravity_and_jump.md)|점프를 구현하기 위해 중력을 구현|
|[스프라이트](./sprite.md)|스프라이트 애니메이션|
Expand Down Expand Up @@ -45,6 +46,7 @@
- [x] 설정
- [x] ESC 화면
- [x] 동적 텍스트 애니메이션
- [ ] 노이즈
- [x] 시간 관리
- [x] 중력 + 점프
- [x] 스프라이트
Expand Down
13 changes: 13 additions & 0 deletions docs/submission/noise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 노이즈
![1](../images/noise_1.png)

![2](../images/noise_2.png)

![3](../images/noise_3.png)

## 인게임
![4](../images/noise_4.png)

## 참조
- [`noise.py`](../../components/events/noise.py)
- [`maps/__init__.py`](../../maps/__init__.py)
10 changes: 5 additions & 5 deletions maps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def render(self, frame_count: int):
"""
self.background.set_pos(CONFIG.camera_x, self.background.y)

background_image = self.background.image.convert()
background_image = self.background.image.convert() # 기존 배경 이미지

if TimeEvent.is_rewind:
noise = NoiseEvent.make_noise()
background_image = NoiseEvent.blend(noise, background_image)
if TimeEvent.is_rewind: # 시간을 되감고 있는 경우
noise = NoiseEvent.make_noise() # 노이즈 이미지 생성
background_image = NoiseEvent.blend(noise, background_image) # 노이즈 이미지와 기존 배경 이미지를 합성 후 배경 이미지에 할당

CONFIG.surface.blit(background_image.convert(), self.background.get_pos())
CONFIG.surface.blit(background_image.convert(), self.background.get_pos()) # 상황에 맞게 배경 이미지 렌더링
CONFIG.surface.blit(self.floor.image, self.floor.get_pos())

World.process_gravity(self.enemies + [self.player], self.floor.y) # 중력 구현
Expand Down

0 comments on commit f12c225

Please sign in to comment.