Skip to content

Instantly share code, notes, and snippets.

View jessefreeman's full-sized avatar

Jesse Freeman jessefreeman

View GitHub Profile

Step 1

Create a new Lua file called code.lua in your Workspace/Sandbox/ folder.

Copyright (c``) 2017, Jesse Freeman. All rights reserved.

Licensed under the Microsoft Public License (MS-PL) License. See LICENSE file in the project root for full license information.

--[[
Pixel Vision 8 - Spirally Spiral
https://twitter.com/guerragames/status/974361013679247360
Created by Jose Guerra (@guerragames)
Ported to PV8 by Jesse Freeman (@jessefreeman)
]]--
x, y = 0, 0
t = 0
--[[
Pixel Vision 8 - Egghead 30 Second Demo
]]--
-- The Init() method is part of the game's lifecycle and called a game starts. We are going to
-- use this method to configure background color, ScreenBufferChip and draw a text box.
function Init()
-- Here we are manually changing the background color
BackgroundColor(32)
@jessefreeman
jessefreeman / DrawSpriteDemo.md
Last active January 11, 2017 18:18
Test for v1 of auto tutorial generation from code.

Step 1

Create a new C# file called DrawSpriteDemo.cs in your project's source folder.

Step 2

Add the following namespaces to the top of the file:

001 using System;
002 using PixelVisionSDK.Engine.Chips.Data;
003 using PixelVisionSDK.Engine.Chips.Game;
004 using PixelVisionSDK.Engine.Utils;
@jessefreeman
jessefreeman / code.lua
Created May 28, 2016 18:16
Sample code showing off how PixelVision8 (http://pixelvision8.com) works to display and animate a sprite and capture player imput.
local apiBridge = LuaBridge()
-- Gameboy Game
-- Resolution 160 x 144
-- Max sprites: 40
-- variables for game
animDelay = 0
animTime = .5
currentAnim = 0
@jessefreeman
jessefreeman / PixelPerfectCamera.cs
Created May 12, 2016 12:47
Pixel Perfect camera that supports landscape and portrait modes
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public enum ScaleDirection{
Width,
Height
}
public class PixelPerfectCamera : MonoBehaviour {
@jessefreeman
jessefreeman / TextureData.cs
Created April 6, 2016 15:15
A class that emulates the API of Unity's Texture2D but uses int as references to color index instead of the color class.
using System;
namespace PixelVision.Engine.Chips.Graphics.Sprites
{
public interface ITextureData
{
int width { get; }
int height { get; }
int GetPixel(int x, int y);
void SetPixel(int x, int y, int value);
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using PixelVision.Framework.Utils;
using PixelVision.Engine;
namespace PixelVision.App.UI{
public class GridPosition
@jessefreeman
jessefreeman / .gitignore
Created October 6, 2015 14:08
My Unity .gitignore file
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
using System;
using UnityEngine;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class GameObjectUtil
{