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
-- | |
-- Project: What the Shell?! | |
-- Description: | |
-- | |
-- Version: 1.0 | |
-- | |
-- Copyright 2016 Three Ring Ranch. All Rights Reserved. | |
-- | |
-- most commonly used screen coordinates |
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
<?php | |
ob_start(); | |
include 'act_dbconnect.php'; | |
// | |
// Sonic Sneak - Server Edition | |
// Another Mohawk Man Creation |
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
Vector2 GetWorldPosition(int col, int row) | |
{ | |
return new Vector2 (transform.position.x - numCols/2.0f + col, transform.position.y + numRows/2.0f - row); | |
} |
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
using UnityEngine; | |
using System.Collections; | |
public class Pickup : MonoBehaviour { | |
public GameObject pickupEffect; // optional prefab particle effect | |
void OnTriggerEnter2D (Collider2D other) | |
{ | |
if (other.CompareTag("Player")) |
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
#pragma strict | |
import UnityEngine.UI; | |
private var origPos : Vector2; | |
public var animalName : String; | |
public var touchingWord : GameObject; | |
function Start () | |
{ |
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
local map | |
local level01 = require("wasilla") -- the Tiled map exported as wasilla.lua | |
--======================================================================================= | |
-- pass in the table that holds the level info from: local level01 = require("level01") | |
-- get back a table that can be used as a map for Pathfinder | |
--======================================================================================= | |
local function walkableMapFromTMX(lvl) | |
local t = {} | |
local idx = 1 | |
for h = 1, lvl.layers[1].height do |
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
-- works like PHP explode() function | |
function explode(div,str) -- credit: http://richard.warburton.it | |
if (div=='') then return false end | |
local pos,arr = 0,{} | |
-- for each divider found | |
for st,sp in function() return string.find(str,div,pos,true) end do | |
table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider | |
pos = sp + 1 -- Jump past current divider | |
end | |
table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider |
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
-- most commonly used screen coordinates | |
local centerX = display.contentCenterX | |
local centerY = display.contentCenterY | |
local screenLeft = display.screenOriginX | |
local screenWidth = display.viewableContentWidth - screenLeft * 2 | |
local screenRight = screenLeft + screenWidth | |
local screenTop = display.screenOriginY | |
local screenHeight = display.viewableContentHeight - screenTop * 2 | |
local screenBottom = screenTop + screenHeight | |
local screenTopSB = screenTop + display.topStatusBarContentHeight -- when status bar is showing |
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
using UnityEngine; | |
using System.Collections; | |
public class Animal : MonoBehaviour { | |
private Vector2 origPos; | |
public string animalName; | |
public bool returnToOrigin = false; | |
void Start () { |
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
using UnityEngine; | |
using System.Collections; | |
public class SpawnAnimal : MonoBehaviour { | |
public GameObject animalPrefab; | |
public Sprite[] animalSprites; | |
public void MakeRandomAnimal() | |
{ |
NewerOlder