Skip to content

Instantly share code, notes, and snippets.

View uruskan's full-sized avatar

Umut Piynar uruskan

View GitHub Profile
@uruskan
uruskan / TankMove.cs
Created March 26, 2017 19:18
Rotate and Move 2D Gameobject to the click/touch position.
using UnityEngine;
using System.Collections;
public class TankMove : MonoBehaviour
{
public float speed = 1.5f;
private Vector3 target; //that's for moving
private Vector3 target_rot; // that's for rotating
//i seperated rotation and movement because in line 33 i did some changes in the target.position and we shouldnt change the target.position for rotatin (we need to change it for moving)
using UnityEngine; using System.Collections; public class Ball : MonoBehaviour { public float powerPerPixel; // force per one pixel flick public float maxPower; // force limiter public float sensitivity; // the higher, the more control to the right and left private Vector3 touchPos; private bool isRolling; // true after throwing the ball void Start () { isRolling = false; } void Update () { if (!isRolling) { if (Input.GetMouseButtonDown(0)) { touchPos = Input.mousePosition; // remember the initial touch position } else if (Input.GetMouseButtonUp(0)) { isRolling = true; //stop detecting touches Vector3 releasePos = Input.mousePosition; float swipeDistanceY = releasePos.y - touchPos.y; // flicking distance in Y-axis float power = swipeDistanceY * powerPerPixel; float swipeDistanceX = releasePos.x - touchPos.x; // flicking distance in X-axis float throwDirection = swipeDistanceX * sensitivity; if (power < 0) { power *= -1; // invert the sign if the value is negative } if (power > maxPower) { power = maxPower
@uruskan
uruskan / benlik.txt
Created May 15, 2017 16:59
Benlik - Emre Temel Eski Mahluklardan
Ben kim miyim? Hiç kimse değilim.Benliklerimiz bize sonradan aşılandı öyleyse ben diye bir şey yok.Hiç bir zaman varolmadı insanların yüklediği bir anlamdan ibaretti.Kimliklerimiz bize sonradan aşılandı.Asla bir insan olmadık,bir baba,bir öğrenci,bir doktor,bir arkadaş yahut bir çocuk asla olmadık bunlar bizlere sonradan aşılandı.Senin kimliğin diye yutturuldu.Ne diyebilirim ki? Tesadüfe,aşka,zamanın varlığına ve var olduğumuza inanmam.Tesadüf yok herşey birbiriyle bağlantılı aşk tanrının insanı cezalandırmak için yarattığı bir olgu zaman algımızın oluşturduğu bir saçmalık ve evren madde dahil gördüğümüz duyduğumuz herşey bilinçler.
@uruskan
uruskan / ygssayaci.ini
Created June 14, 2017 15:43
Rainmeter YGS Sayacı Widget Kodu
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=https://www.universitego.com/2018-ygs-geri-sayim/
@uruskan
uruskan / teleporthack.s
Created June 20, 2017 20:26
Teleport Hack Concept
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(code)
label(save_coords)
label(load_coords)
label(xpos)
section .data
msg db "hello, world!"
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, 13
int girdi = 0;
int buzzer = 8;
int buttonPin = 12;
boolean flag; //sürekli seriali kullanmasın diye
void setup() {
// put your setup code here, to run once:
pinMode(buzzer,OUTPUT);
pinMode(buttonPin,INPUT_PULLUP);
Serial.begin(9600);
}
@uruskan
uruskan / pitches.h
Created August 24, 2017 12:41
Nota - Frekans
// This file contains a list of 8 octaves worth of pitches
// that correspond to notes on the piano.
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
@uruskan
uruskan / sketch_luna_mastered.ino
Created August 24, 2017 12:43
8bit Melody Generator
#include "pitches.h"
int val;
// notes in the melody:
int melody[] = {
NOTE_C3, NOTE_D3, NOTE_E3, NOTE_F3, NOTE_G3, 0, NOTE_A3, NOTE_B3
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 4, 4, 4, 4, 4, 4, 4
@uruskan
uruskan / EmplooyeSystem.py
Created September 3, 2017 15:54
Emplooye System
Employees = {
}
class Employee(object):
'Common base for all employes'
empCount = 0
def __init__(self,name,salary,age):
self.name = name
self.salary = salary
self.age = age