This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| protocol HeroState { } | |
| class HeroPresenting: HeroState { | |
| let hero: Hero | |
| let nextAvailable: Bool | |
| let previousAvailable: Bool | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| class HeroSelector { | |
| // MARK: State | |
| let heroes: [Hero] | |
| var heroId: Int = 0 | |
| // MARK: Properties | |
| var previousHero: Hero? { return getPreviousHero() } | |
| var nextHero: Hero? { return getNextHero() } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| class Hero { | |
| let name: String | |
| let speed: Float | |
| let power: Float | |
| let stamina: Float | |
| init(_ name: String, speed: Float, power: Float, stamina: Float) { | |
| self.name = name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import RxSwift | |
| import RxCocoa | |
| class MainViewController: UIViewController { | |
| // MARK: Outlets | |
| @IBOutlet weak var nameLabel: UILabel! | |
| @IBOutlet weak var imageView: UIImageView! | |
| @IBOutlet weak var speed: UIProgressView! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import RxSwift | |
| import RxCocoa | |
| class MainIntent { | |
| var stateRelay: PublishRelay<HeroState> | |
| var view: MainViewController? | |
| let heroSelector = HeroSelector() | |
| var disposeBag = DisposeBag() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class BulletTest : MonoBehaviour { | |
| public SimpleBullet Bullet; | |
| public Transform Eject; | |
| [Range(1,200)] | |
| public float Speed = 50; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class SimpleBullet : MonoBehaviour | |
| { | |
| // The global Gravity all projectiles share. Independent from actual physics | |
| private const float Gravity = 9.81f; | |
| private Vector3 Velocity; | |
| public void Shoot(float speed, float angleX, float angleY) { | |
| // Get 2D V0x and V0y |