Comments (3)
우선 위치가 맞도록 맞춰놓긴 했는데
이 부분에 시간을 더 투자하는 게 적절하지 않을 것 같아서 우선 넘어가는 것이 나을 것 같습니다!
from baseball.
from baseball.
현재 코드
BaseDrawingProperty
struct BaseDrawingProperty {
let id: Int
let origin: CGPoint
let size: CGSize
func centerMovedBy(x: CGFloat, y: CGFloat) -> CGPoint {
let newX = origin.x + x + size.width / 2
let newY = origin.y + y - size.height / 2
return CGPoint(x: newX, y: newY)
}
}
Player 초기 설정
private func addPlayer(to baseInfo: BaseDrawingProperty) {
let playerWidth = width * 0.06
let playerHeight = playerWidth * 1.5
let playerSize = CGSize(width: playerWidth, height: playerHeight)
let offsetX = playerWidth / 2
let playerOrigin = baseInfo.centerMovedBy(x: -offsetX, y: 0)
//(이하 생략)
- x만 옮겨줌
애니메이션 부분
private func animatePlayer(with fromBaseInfo: BaseDrawingProperty,_ toBaseInfo: BaseDrawingProperty, duration: Double, delay: Double) {
let offsetY = player.frame.height / 2
let fromPosition = fromBaseInfo.centerMovedBy(x: 0, y: offsetY)
let toPosition = toBaseInfo.centerMovedBy(x: 0, y: offsetY)
//(이하 생략)
- y만 옮겨줌
from baseball.
Related Issues (20)
- [BE] MOCK API 구현
- [BE] DB Schema 설계
- [iOS] 게임 모델 구현 HOT 6
- [BE] Entity 구현
- [BE] API 구현
- [iOS] 게임 진행 화면 Mock API Test HOT 1
- [iOS] 게임 선택 네트워크 디코딩 에러 HOT 3
- [BE] 서버 배포 자동화
- [iOS] 야구장 그래픽 및 애니메이션 HOT 1
- [iOS] 게임 선택 → 게임 진행 화면 이동 HOT 10
- Game DTO 형식 정하기 HOT 12
- [iOS] PR review 반영 HOT 14
- [iOS] pitch로 게임 진행하기 HOT 1
- [iOS] iPad 이상 사이즈에서 일부 그래픽 깨지는 현상 HOT 2
- [BE] 코드 리팩토링
- [iOS] pitch 결과로 화면 업데이트 시의 버그 HOT 1
- [iOS] 네비게이션 컨트롤러로 애니메이션 없이 화면 전환 시 그래픽이 깨지는 현상
- [iOS] Memory Leak? HOT 4
- [iOS] 이닝 전환 / 점수 변화 시 사용자에게 알리기 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baseball.