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
float x = -Input.acceleration.x * 180; | |
float y = Input.acceleration.y * 180; | |
x = limit (x, MAX_ANGLE); | |
y = limit (y, MAX_ANGLE); | |
Quaternion quato = Quaternion.Euler(y, 0, x); | |
rb.transform.rotation = Quaternion.Lerp(rb.transform.rotation, quato, Time.deltaTime * 5.0f); |
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
private String getRandomizedWords(int word_count) { | |
String contentAsString = ""; | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
while(word_count-- > 0) { | |
// generate word | |
int wordLength = Math.abs((rnd.nextInt() % MAX_WORD_LENGTH) + 1); | |
for(int i = 0; i < wordLength; i++) { | |
int val = Math.abs((rnd.nextInt() % 62) + 1); | |
char nextChar = ' '; | |
if (val >= 0 && val <= 9) { |
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
public class SelectionHandleListener implements View.OnTouchListener { | |
float x, y; | |
@Override | |
public boolean onTouch(View view, MotionEvent motionEvent) { | |
float rx = motionEvent.getRawX(); | |
float ry = motionEvent.getRawY(); | |
switch(motionEvent.getAction()) { | |
case MotionEvent.ACTION_DOWN: | |
case MotionEvent.ACTION_POINTER_DOWN: | |
x = rx; |
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
-(void) searchForPlaces { | |
ACAccountStore *store = [[ACAccountStore alloc] init]; | |
ACAccountType *type = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; | |
NSArray *permissions = @[@"email"]; | |
NSDictionary *options = @{ ACFacebookAppIdKey : @"229934313842253", ACFacebookPermissionsKey : permissions, ACFacebookAudienceKey : ACFacebookAudienceOnlyMe }; | |
[store requestAccessToAccountsWithType:type options:options completion:^(BOOL granted, NSError *error) { | |
NSArray *accounts = [store accountsWithAccountType:type]; | |