Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e300e87
Reading for next iteration
erickzanardo May 31, 2020
ab1728e
Create README-PL.md
mbiesiad May 31, 2020
1f4a17c
Update README.md
mbiesiad May 31, 2020
4d9b0da
Update README-PL.md
mbiesiad May 31, 2020
5abaf39
Update README.md
mbiesiad May 31, 2020
650eff1
Update README-PL.md
mbiesiad May 31, 2020
9582148
Update README-PL.md
mbiesiad May 31, 2020
2f978c0
Fix Box2DComponents render priority
spydon Jun 2, 2020
a779b09
Update changelog with render priority fix
spydon Jun 2, 2020
9f44c0a
Merge branch 'master' into develop
erickzanardo Jun 3, 2020
115e510
Merge pull request #366 from mbiesiad/pl_PL
erickzanardo Jun 3, 2020
d291ea0
Merge pull request #369 from flame-engine/spydon.box2d-render-priority
erickzanardo Jun 3, 2020
4dbba7c
Correct drift modifier
spydon Jun 5, 2020
3fd29a8
Correct drift modifier for when effect is finished
spydon Jun 5, 2020
03b7397
Fix formatting
spydon Jun 5, 2020
26e9273
Added changelog entry
spydon Jun 5, 2020
53359e5
Add an effect where you can combine several effects
spydon Jun 5, 2020
130a69d
Added example for CombinedEffect
spydon Jun 5, 2020
f80d0a5
Rename example to combined_effects to follow convention
spydon Jun 5, 2020
ec57728
Add docs for CombinedEffect
spydon Jun 5, 2020
c1cbbc0
Fix typo
spydon Jun 5, 2020
5cd081a
Add changelog entry for CombinedEffect
spydon Jun 5, 2020
5aed2da
Remove accidentally added test
spydon Jun 5, 2020
b278f07
Updated according to comments
spydon Jun 5, 2020
200e561
Upgrade to box2d_flame that fixes torque bug
spydon Jun 7, 2020
50f6bbe
Change wording to re-trigger CI
spydon Jun 7, 2020
ac3fbec
Fix broken link
spydon Jun 8, 2020
3816192
Merge pull request #377 from flame-engine/spydon.update-box2d
erickzanardo Jun 10, 2020
31ce152
Merge branch 'develop' into spydon.fix-effect-drifting
erickzanardo Jun 10, 2020
8a57884
Merge pull request #375 from flame-engine/spydon.fix-effect-drifting
erickzanardo Jun 10, 2020
b9c5f46
Merge branch 'develop' into spydon.combined-effect
erickzanardo Jun 10, 2020
15daa31
Merge pull request #376 from flame-engine/spydon.combined-effect
erickzanardo Jun 10, 2020
ff6b28f
Adding SpriteSheet.fromImage
erickzanardo Jun 16, 2020
281efa4
Spydons suggestions
erickzanardo Jun 17, 2020
14a4313
Luan linter
erickzanardo Jun 17, 2020
c1b8ed7
Merge pull request #382 from flame-engine/erick.spritesshet-fromimage
erickzanardo Jun 17, 2020
7775e80
Bumping version
erickzanardo Jun 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## 0.22.1
- Fix Box2DComponent render priority
- Fix PositionComponentEffect drifting
- Add possibility to combine effects
- Update to newest box2d_flame which fixes torque bug
- Adding SpriteSheet.fromImage

## 0.22.0
- Fixing BaseGame tap detectors issues
- Adding SpriteWidget
Expand Down
93 changes: 93 additions & 0 deletions README-PL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[![Pub](https://img.shields.io/pub/v/flame.svg?style=popout)](https://pub.dartlang.org/packages/flame) ![Test](https://github.com/flame-engine/flame/workflows/Test/badge.svg?branch=master&event=push) [![Discord](https://img.shields.io/discord/509714518008528896.svg)](https://discord.gg/pxrBmy4)

_Jest to nieoficjalne tłumaczenie. W chwili tłumaczenia wersja v0.22.0._

<img src="https://i.imgur.com/vFDilXT.png" width="400">

[English](https://github.com/flame-engine/flame) | [简体中文](README-ZH.md) | [Polski](https://github.com/mbiesiad/flame/blob/pl_PL/README-PL.md)

Minimalistyczny silnik gry Flutter.

## Pomoc

Mamy kanał pomocy Flame na Discord Fireslime, dołącz do niego [tutaj](https://discord.gg/pxrBmy4).

Mamy też najczęściej zadawane pytania - [FAQ](FAQ.md), więc najpierw wyszukaj tam swoje pytanie.

## Cele

Celem tego projektu jest dostarczenie kompletnego zestawu nietypowych rozwiązań dla typowych problemów, z którymi każda gra opracowana we Flutter będzie się dzielić.

Obecnie zapewnia elementy takie jak:
- pętla gry
- system komponent/obiekt
- dołącza silnik fizyki (box2d)
- wsparcie audio
- efekty i cząstki
- obsługa gestów i wprowadzania danych
- obrazy, duszki (sprites) i arkusze duszka
- podstawowe wsparcie Rive
- i kilka innych narzędzi ułatwiających programowanie

Możesz użyć dowolnego z nich, ponieważ wszystkie są nieco niezależne.

## Wsparcie

Najprostszym sposobem, aby pokazać nam swoje wsparcie, jest przyznanie gwiazdki (star) dla projektu.

Możesz nas wesprzeć, zostając patronem na Patreon:

[![Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/fireslime)

Lub przekazując jakąś darowiznę, kupując nam kawę:

[![Buy Me A Coffee](https://user-images.githubusercontent.com/835641/60540201-fcd7fa00-9ce4-11e9-87ec-1e98568e9f58.png)](https://www.buymeacoffee.com/fireslime)

Możesz również pokazać w swoim repozytorium, że twoja gra została wykonana przy użyciu Flame'a, używając jednej z następujących odznak:

[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg)](https://flame-engine.org)
[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg?style=flat-square)](https://flame-engine.org)
[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg?style=for-the-badge)](https://flame-engine.org)

```
[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg)](https://flame-engine.org)
[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg?style=flat-square)](https://flame-engine.org)
[![Powered by Flame](https://img.shields.io/badge/Powered%20by-%F0%9F%94%A5-orange.svg?style=for-the-badge)](https://flame-engine.org)
```

## Współtworzenie

Każda pomoc jest mile widziana! Komentarze, sugestie, issues, PR.

Jeśli znalazłeś błąd lub masz sugestię, jak ulepszyć Flame, otwórz issue, a my zajmiemy się nim jak najszybciej.

Czy chcesz przyczynić się do projektu tworząc PR? PR są zawsze mile widziane, po prostu utwórz je z gałęzi `develop` i postępuj zgodnie z [listą kontrolną](.github/pull_request_template.md) która pojawi się po otwarciu.

## Rozpocznij
Sprawdź tę wspaniałą serię artykułów/samouczków napisanych przez [Alekhin](https://github.com/japalekhin)

- [Utwórz grę mobilną za pomocą Flutter'a i Flame'a - tutorial dla początkujących](https://jap.alekhin.io/create-mobile-game-flutter-flame-beginner-tutorial)
- [Samouczek 2D na urządzenia mobilne - krok po kroku z Flame i Flutter (część 1 z 5)](https://jap.alekhin.io/2d-casual-mobile-game-tutorial-flame-flutter-part-1)
- [Samouczek grafiki i animacji gry - krok po kroku z Flame i Flutter (część 2 z 5)](https://jap.alekhin.io/game-graphics-and-animation-tutorial-flame-flutter-part-2)
- [Samouczek widoków i okien dialogowych - krok po kroku z Flame i Flutter (część 3 z 5)](https://jap.alekhin.io/views-dialog-boxes-tutorial-flame-flutter-part-3)
- [Samouczek dotyczący przyznawania punktów, przechowywania i dźwięku - krok po kroku z Flame i Flutter (część 4 z 5)](https://jap.alekhin.io/scoring-storage-sound-tutorial-flame-flutter-part-4)
- [Samouczek wykańczania i pakowania - krok po kroku z Flame i Flutter (część 5 z 5)](https://jap.alekhin.io/game-finishing-packaging-tutorial-flame-flutter-part-5)

Oferujemy również wyselekcjonowaną listę gier, bibliotek i artykułów na stronie [awesome-flame](https://github.com/flame-engine/awesome-flame).

Pamiętaj, że niektóre artykuły mogą być nieco nieaktualne, ale nadal są przydatne.

## Dokumentacja

Pełna dokumentacja znajduje się [tutaj](doc/README.md).

Wiele przykładów różnych funkcji można znaleźć [tutaj](doc/examples), a dobry przykład na start można znaleźć [tutaj](/example).

Oficjalną stronę Flame, która zawiera również dokumentację, można znaleźć [tutaj](https://flame-engine.org/).

## Uznanie

* [Fireslime](https://fireslime.xyz), zespół odpowiedzialny za utrzymanie Flame'a.
* Wszyscy życzliwi współtwórcy i ludzie, którzy pomagają w społeczności.
* [Luanpotter](https://github.com/luanpotter)'a (założyciel Flame) biblioteka [audioplayers](https://github.com/luanpotter/audioplayer) lib, która z kolei jest rozwidlona (zforkowana) z [rxlabz's](https://github.com/rxlabz/audioplayer).
* Port Dart w [Box2D](https://github.com/google/box2d.dart).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img src="https://i.imgur.com/vFDilXT.png" width="400">

English | [简体中文](README-ZH.md)
[English](https://github.com/flame-engine/flame) | [简体中文](README-ZH.md) | [Polski](https://github.com/mbiesiad/flame/blob/pl_PL/README-PL.md)

A minimalistic Flutter game engine.

Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Put the pub package as your dependency by dropping the following in your `pubspe

```yaml
dependencies:
flame: ^0.22.0
flame: ^0.22.1
```

And start using it!
Expand Down
4 changes: 2 additions & 2 deletions doc/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,6 @@ Check the example app `nine_tile_box` details on how to use it.

## Effects

Flame provides a set of effects that can be applied to a certain type of components, these effects can be used to animate some properties of your components, like position or dimensions. You can check the list of those effects [here](/doc/effects.md)
Flame provides a set of effects that can be applied to a certain type of components, these effects can be used to animate some properties of your components, like position or dimensions. You can check the list of those effects [here](/doc/effects.md).

Examples of the running effects can be found [here](/doc/examples/effects.md);
Examples of the running effects can be found [here](/doc/examples/effects);
22 changes: 21 additions & 1 deletion doc/effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ myComponent.addEffect(sequence);
```
An example of how to use the SequenceEffect can be found [here](/doc/examples/effects/sequence_effect).

## CombinedEffect

This effect runs several different type of effects simultaneously. You provide it with a list of your predefined effects and an offset in time which should pass in between starting each effect.

The effects in the list should only be passed to the CombinedEffect, never added to a PositionComponent with `addEffect`.

Note that no effects should be of the same type since they will clash when trying to modify the PositionComponent.

You can make the combined effect go in a loop by setting both `isInfinite: true` and `isAlternating: true`.

Usage example:
```dart
final combination = CombinedEffect(
effects: [move, scale, rotate],
isInfinite: true,
isAlternating: true);
myComponent.addEffect(combination);
```
An example of how to use the CombinedEffect can be found [here](/doc/examples/effects/combined_effect).

# Examples

Full examples can be found [here](/doc/examples/effects/simple) and [here](/doc/examples/effects/infinite_effects).
Full examples can be found [here](/doc/examples/effects/simple), [here](/doc/examples/effects/infinite_effects) and [here](/doc/examples/effects/combined_effects).
70 changes: 70 additions & 0 deletions doc/examples/effects/combined_effects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Visual Studio Code related
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions doc/examples/effects/combined_effects/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 7fc14a55af64462763d28abfb4e610086c6e0f39
channel: dev

project_type: app
3 changes: 3 additions & 0 deletions doc/examples/effects/combined_effects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Combined effect

A Flame game showcasing how to combine effects.
71 changes: 71 additions & 0 deletions doc/examples/effects/combined_effects/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import 'package:flame/effects/combined_effect.dart';
import 'package:flame/effects/move_effect.dart';
import 'package:flame/effects/scale_effect.dart';
import 'package:flame/effects/rotate_effect.dart';
import 'package:flame/gestures.dart';
import 'package:flame/position.dart';
import 'package:flame/flame.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';

import 'dart:math';

import './square.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Flame.util.fullScreen();
runApp(MyGame().widget);
}

class MyGame extends BaseGame with TapDetector {
Square greenSquare;

MyGame() {
final green = Paint()..color = const Color(0xAA338833);
final red = Paint()..color = const Color(0xAA883333);
greenSquare = Square(green, 100, 100);
final redSquare = Square(red, 100, 100);
add(greenSquare);
add(redSquare);
}

@override
void onTapUp(TapUpDetails details) {
final dx = details.localPosition.dx;
final dy = details.localPosition.dy;
greenSquare.clearEffects();

final move = MoveEffect(
destination: Position(dx, dy),
speed: 250.0,
curve: Curves.linear,
isInfinite: false,
isAlternating: false,
);

final scale = ScaleEffect(
size: Size(dx, dy),
speed: 250.0,
curve: Curves.linear,
isInfinite: false,
isAlternating: false,
);

final rotate = RotateEffect(
radians: (dx + dy) % pi,
speed: 1.5,
curve: Curves.decelerate,
isInfinite: false,
isAlternating: false,
);

final combination = CombinedEffect(
effects: [move, rotate, scale],
isInfinite: false,
isAlternating: true,
offset: 0.5,
);
greenSquare.addEffect(combination);
}
}
24 changes: 24 additions & 0 deletions doc/examples/effects/combined_effects/lib/square.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:flame/anchor.dart';
import 'package:flame/components/component.dart';

import 'dart:ui';

class Square extends PositionComponent {
final Paint _paint;

Square(this._paint, double x, double y, {double angle = 0.0}) {
width = 100;
height = 100;
this.x = x;
this.y = y;
this.angle = angle;
anchor = Anchor.center;
}

@override
void render(Canvas canvas) {
prepareCanvas(canvas);
final rect = Rect.fromLTWH(0, 0, width, height);
canvas.drawRect(rect, _paint);
}
}
17 changes: 17 additions & 0 deletions doc/examples/effects/combined_effects/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: combined_effects
description: Flame sample game showcasing combined effects

version: 1.0.0+1

environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flame:
path: ../../../../

dev_dependencies:
flutter_test:
sdk: flutter
3 changes: 3 additions & 0 deletions doc/examples/spritesheet/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

lib/generated_plugin_registrant.dart
web/
Loading