This file contains 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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform float time; | |
uniform vec2 resolution; | |
uniform vec4 mouse; | |
uniform sampler2D tex0; | |
uniform sampler2D tex1; |
This file contains 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
if (e.type == MouseEvent.MOUSE_DOWN) | |
{ | |
if (last_dt == 0) //first time. no avg yet. | |
{ | |
last_dt = getTimer(); | |
} | |
else | |
{ | |
if (new_dt == 0) //second time, first cps, first average | |
{ |
This file contains 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
float degangle = atan2f(t_dir.x, t_dir.y)*180/M_PI; | |
//pushing it down, so that -22.5 becomes the new 0 | |
degangle += 22.5f; | |
//now making the final range as 0 - 360 | |
if (degangle < 0) degangle += 360; | |
//now this var is ranged 0 - 7, with -22.5f to 22.5f being 0 and so on... | |
m_DirectionIndex = (int)floorf(degangle/22.5f); |
This file contains 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
package | |
{ | |
import flash.display.Bitmap; | |
import flash.display.BitmapData; | |
import flash.display.BlendMode; | |
import flash.display.CapsStyle; | |
import flash.display.Sprite; | |
import flash.filters.BitmapFilter; | |
import flash.filters.GlowFilter; | |
import flash.geom.ColorTransform; |
This file contains 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
void Update () | |
{ | |
if ( Input.GetMouseButtonDown(0) ) | |
{ | |
Ray inputRay = Camera.main.ScreenPointToRay(Input.mousePosition); | |
RaycastHit myHitInfo = new RaycastHit(); | |
if ( GetComponent<BoxCollider>().Raycast(inputRay, out myHitInfo, 10000f ) ) | |
Debug.Log("Clicked"); |
This file contains 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
## Hey there ## | |
**This is important, leave immediately** | |
*has never worked for anyone ever* |
This file contains 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
//code | |
int amazingAddMethod(int a, int b) | |
{ | |
return a+b; | |
} | |
//test | |
void testForAmazingAddMethod(int a, int b) | |
{ | |
for (int a = 0; a < 10; a++) |
This file contains 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
//non unit-testable code | |
class Saver | |
{ | |
void SaveMethod(string filename) | |
{ | |
//do everything else before the following calls | |
DateTime dateTime = DateTime.Now(); | |
FileManager.Save(filename, dateTime.ToString()); | |
} | |
} |
This file contains 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
SaveMethod(string filename, IDateTimeProvider dateTime, IFileManager fileManager); |