Skip to content

Instantly share code, notes, and snippets.

View rsaenzi's full-sized avatar
🏠
Working from home

Rigoberto Sáenz Imbacuán rsaenzi

🏠
Working from home
View GitHub Profile
@rsaenzi
rsaenzi / CharacterController2D.cs
Last active April 16, 2021 23:49
Script for Unity to control the main character in an 2D platformer game
//
// CharacterController2D.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / MissileControl.cs
Last active April 12, 2021 04:06
Script for Unity to control a missile in an air combat game
//
// MissileControl.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / AircraftControl.cs
Last active April 16, 2021 23:19
Script for Unity to add basic motion and shooting controls to a airplane in an air combat game
//
// AircraftControl.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / PingPongPaddle.cs
Last active April 16, 2021 23:26
Script for Unity to move two rackets independently using the keyboard in a table tennis game
//
// PingPongPaddle.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / SelfRotation.cs
Last active April 12, 2021 04:15
Script for Unity to rotate a GameObject around Y axis with constant rotation speed
//
// SelfRotation.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / TranslationAround.cs
Last active April 12, 2021 04:16
Script for Unity to translate a GameObject around another GameObject with constant rotation speed
//
// TranslationAround.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / MotionInOneDirection.cs
Last active April 12, 2021 04:16
Script for Unity to move a GameObject forward with constant speed
//
// MotionInOneDirection.cs
//
// Created by Rigoberto Sáenz Imbacuán (https://linkedin.com/in/rsaenzi/)
// Copyright © 2021. All rights reserved.
//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@rsaenzi
rsaenzi / GetPopularMoviesInteractor.swift
Last active July 20, 2019 19:40
Request and Response examples for parsing Json objects using Moya and Codable
//
// GetPopularMoviesInteractor.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import Moya
typealias GetPopularMoviesCallback = (_ response: GetPopularMoviesResponse) -> Void
@rsaenzi
rsaenzi / ApiRequest.swift
Last active July 20, 2019 19:44
RequestApi and ResponseApi classes to process the input/output of an endpoint call using Moya
//
// ApiRequest.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
import Foundation
import Reachability
import Moya
@rsaenzi
rsaenzi / Formatter.swift
Last active July 23, 2019 22:28
Common formatters for dates and currencies in Swift
//
// Formatter.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2019. All rights reserved.
//
import Foundation
public class Formatter {