Skip to content

Commit

Permalink
Refactor code to improve performance and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
uumair327 committed Mar 23, 2024
1 parent c5415f7 commit 8c4d1ed
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 40 deletions.
79 changes: 39 additions & 40 deletions posts/post/etc/facebook-interlock-cocos2dx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,53 @@ layout: post
title: Facebook Interlock Cocos2d-X ver.
date: 2017-03-22
category: Etc
description: 페이스북 연동 Cocos2d-X
description: Facebook Interlocking with Cocos2d-X
tags: [Dev, Facebook, Interlock, Cocos2d-X]
keywords: Facebook, Interlock, cocos2d
---

- Facebook Interlock github [링크](https://github.com/kyechan99/Facebook_Interlock)
- Facebook 개발자 사이트 [링크](https://developers.facebook.com)
- JNI 사용법 [링크](http://blog.naver.com/kyechan99/220552861010)
- Facebook Interlock github [link](https://github.com/kyechan99/Facebook_Interlock)
- Facebook Developer Site [link](https://developers.facebook.com)
- JNI Usage Guide [link](http://blog.naver.com/kyechan99/220552861010)

## 참고
## Reference

Facebook 의 [README](https://github.com/kyechan99/Facebook_Interlock/blob/master/README.md) 를 참고
Refer to Facebook's [README](https://github.com/kyechan99/Facebook_Interlock/blob/master/README.md)

## 개요
## Overview

1. 개발자 등록
2. 이클립스 환경 설정
3. 오류 해결
4. AndroidManifext.xml 수정
5. String.xml 수정
6. AppActivity 수정
7. JNI 이용
1. Developer Registration
2. Eclipse Environment Setup
3. Troubleshooting
4. Modifying AndroidManifest.xml
5. Modifying String.xml
6. Modifying AppActivity
7. Utilizing JNI

## 1. 개발자 등록
## 1. Developer Registration

1. 앱 생성
2. 구글 패키지 이름
3. 클래스 이름
4. 키 해시
1. App Creation
2. Google Package Name
3. Class Name
4. Key Hash

- [참고 사이트](http://moelcano.tistory.com/135)
- [Reference Site](http://moelcano.tistory.com/135)

## 2. 이클립스 환경 설정
## 2. Eclipse Environment Setup

1. 이클립스에 다운 받은 Facebook SDK 를 Import
2. Facebook SDK Library 형식으로 바꿈
3. 프로젝트에 Library 추가
4. [Github Libs]() 에서 `android..` `Bolt..` 를 프로젝트의 Libs 폴더에 넣어 준다.
1. Import Facebook SDK downloaded into Eclipse
2. Convert Facebook SDK to Library format
3. Add Library to the project
4. Put `android..` and `Bolt..` from [Github Libs]() into the project's Libs folder.

## 3. 오류 해결
## 3. Troubleshooting

1. 페이스북 SDK 의 proteries 의 Java Build Path Libraries 에 들어가 Add Jars 에서 android.. 와 Bolt.. 를 추가
2. Proteries 의 Android 에서 SDK 버전을 4.4.2W 버전으로 바꿔준다.
3. Java Compiler 의 JDK 버전을 1.6에서 **1.7**로 바꿔준다.
4. 아직도 에러가 뜬다면 프로젝트의 SDK 버전을 4버전 이상으로 바꿔준다.
1. Add `android..` and `Bolt..` from Facebook SDK's properties -> Java Build Path -> Libraries to Add Jars.
2. Change SDK version to 4.4.2W in Properties -> Android.
3. Change JDK version to **1.7** from 1.6 in Java Compiler.
4. If errors persist, change project's SDK version to above 4.

## 4. AndroidManifest.xml 수정
## 4. Modifying AndroidManifest.xml

```
<activity android:name="com.facebook.FacebookActivity"
Expand All @@ -60,19 +60,18 @@ Facebook 의 [README](https://github.com/kyechan99/Facebook_Interlock/blob/maste
android:value="@string/facebook_app_id"/>
```

를 추가한다.
Add this.

## 5. String.xml 수정
## 5. Modifying String.xml

- rex/values/string.xml 에
`<string name="facebook_app_id">facebookId</string>` 를 추가한다.
- facebookId 에는 개발자 사이트에서 공급받은 키값을 입력한다.
- In rex/values/string.xml, add `<string name="facebook_app_id">facebookId</string>`.
- Enter the key value received from the developer site into facebookId.

## 6. AppActivity 수정
## 6. Modifying AppActivity

- Login 기능 : 참고 [사이트](https://github.com/kyechan99/Facebook_Interlock/tree/master/facebookLogin/src/org/cocos2dx/cpp)
- Share 기능 : 참고 [사이트](https://github.com/kyechan99/Facebook_Interlock/tree/master/facebookShare/src/org/cocos2dx/cpp)
- Login Functionality: Refer to [site](https://github.com/kyechan99/Facebook_Interlock/tree/master/facebookLogin/src/org/cocos2dx/cpp)
- Share Functionality: Refer to [site](https://github.com/kyechan99/Facebook_Interlock/tree/master/facebookShare/src/org/cocos2dx/cpp)

## 7. JNI Helper

- [JNI Helper](https://kyechan99.github.io/2017/03/22/JNI-Helper-Cocos2dX/) 사용하기
- Utilize [JNI Helper](https://kyechan99.github.io/2017/03/22/JNI-Helper-Cocos2dX/)
53 changes: 53 additions & 0 deletions posts/project/games/brickbreaker.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
layout: post
title: Brick Breaker Game with Flutter and Flame Engine
date: 2024-03-23
category: Portfolio
description: A Brick Breaker game developed using Flutter and Flame engine, showcasing my skills in game development and Flutter framework.
tags: [Portfolio, Flutter, Game Development, Brick Breaker, Flame Engine]
keywords: Portfolio, Flutter, Brick Breaker, Game Development, Flame Engine
---

## Introduction

I'm excited to share my latest project - a Brick Breaker game developed using Flutter and the Flame engine. By combining the power of Flutter for UI and Flame for game development, I've created an immersive and dynamic gaming experience. This project serves as a testament to my skills in game development and proficiency in leveraging the Flutter framework.

### Project Details

- **GitHub Repository:** [Brick Breaker Flutter Game](https://github.com/uumair327/brick_breaker)
- **Flutter SDK:** [Flutter](https://docs.flutter.dev/get-started/install?_gl=1*1dct9ge*_up*MQ..&gclid=Cj0KCQjw-_mvBhDwARIsAA-Q0Q4o297tFwfxIa9taiaMFsUYG3k--DiVDTlZ9lPp3p3l3AXztBnZxioaAj7gEALw_wcB&gclsrc=aw.ds)
- **Flame Engine:** [Flame](https://docs.flame-engine.org/latest/#)

## Project Overview

### Game Mechanics

The Brick Breaker game features a paddle controlled by touch gestures, a ball that bounces off surfaces, and bricks arranged in various patterns. The objective is to break all the bricks on the screen by bouncing the ball off the paddle.

### Development Process

1. **Environment Setup**: Ensured Flutter and Flame development environments were properly configured.
2. **Layout Design**: Designed the game layout using Flutter widgets to display the paddle, ball, and bricks.
3. **Interactivity**: Implemented touch controls to move the paddle and utilized Flame engine for physics and game logic.
4. **Game Logic**: Defined collision detection and scoring logic using Flame engine to track player progress.
5. **Game Over Handling**: Implemented logic to detect when the game ends and allow the player to restart.

### Testing and Optimization

Thorough testing was conducted on multiple devices to ensure smooth gameplay and responsiveness. Optimization techniques were employed to enhance performance and minimize any potential bugs or issues.

## Conclusion

Developing the Brick Breaker game with Flutter and Flame engine was a rewarding experience that allowed me to push the boundaries of game development on Flutter. The seamless integration of Flame engine with Flutter's UI capabilities enabled me to create a polished and engaging game.

### Next Steps

I plan to continue exploring the capabilities of Flame engine and Flutter to create more immersive gaming experiences. Additionally, I aim to collaborate with other developers in the Flutter and Flame communities to contribute to open-source projects and further expand my skills.

### Links and References

- [Brick Breaker Flutter Game GitHub Repository](https://github.com/uumair327/brick_breaker)
- [Flutter SDK](https://flutter.dev)
- [Flame Engine](https://flame-engine.org/)

Thank you for taking the time to explore my Brick Breaker game project developed with Flutter and Flame engine. I'm excited to continue my journey in game development and explore new possibilities in the Flutter ecosystem!

0 comments on commit 8c4d1ed

Please sign in to comment.