This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental build containing new renderer and APIs for testing.
- Loading branch information
1 parent
9517cee
commit 10c0543
Showing
1,438 changed files
with
8,266 additions
and
17,889 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
Pixel Vision 8 - BackgrondColor Example | ||
Copyright (C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman (@jessefreeman) | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class BackgroundColorExample : GameChip | ||
{ | ||
public override void Init() | ||
{ | ||
// Get the current background color | ||
var defaultColor = BackgroundColor(); | ||
|
||
// Draw the default background color ID to the display | ||
DrawText("Default Color " + defaultColor, 1, 1, DrawMode.Tile, "large", 15); | ||
|
||
// Here we are manually changing the background color | ||
var newColor = BackgroundColor(2); | ||
|
||
// Draw the new color ID to the display | ||
DrawText("New Color " + newColor, 1, 3, DrawMode.Tile, "large", 15); | ||
} | ||
|
||
public override void Draw() | ||
{ | ||
//Redraw the display | ||
RedrawDisplay(); | ||
} | ||
} | ||
} |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
Pixel Vision 8 - Button Example | ||
Copyright (C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman (@jessefreeman) | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
using System.Collections.Generic; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class ButtonExample : GameChip | ||
{ | ||
// This array will store any buttons pressed during the current frame | ||
private List<string> pressedButtons = new List<string>(); | ||
|
||
// A list of all the buttons to check on each frame | ||
private Buttons[] buttons = | ||
{ | ||
Buttons.Up, | ||
Buttons.Down, | ||
Buttons.Left, | ||
Buttons.Right, | ||
Buttons.A, | ||
Buttons.B, | ||
Buttons.Select, | ||
Buttons.Start | ||
}; | ||
|
||
public override void Update(int timeDelta) | ||
{ | ||
|
||
// Clear the pressedButtons array on each frame | ||
pressedButtons.Clear(); | ||
|
||
// Loop through all the buttons | ||
for (int i = 0; i < buttons.Length; i++) | ||
{ | ||
|
||
// Test if player 1's current button is down and save it to the pressedButtons array | ||
if (Button(buttons[i], InputState.Down, 0)) | ||
{ | ||
pressedButtons.Add(buttons[i].ToString()); | ||
} | ||
|
||
} | ||
} | ||
|
||
public override void Draw() | ||
{ | ||
|
||
// Clear the display | ||
Clear(); | ||
|
||
// Convert the pressedButtons into a string and draw to the display | ||
var message = string.Join(", ", pressedButtons.ToArray()).ToUpper(); | ||
DrawText("Buttons Down:", 8, 8, DrawMode.Sprite, "large", 15); | ||
DrawText(message.Substring(0, message.Length), 8, 16, DrawMode.Sprite, "medium", 14, -4); | ||
|
||
} | ||
} | ||
} |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
Pixel Vision 8 - CalculateDistance Example | ||
Copyright(C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman(@jessefreeman) | ||
This project was designed to display some basic instructions when you create | ||
a new game.Simply delete the following code and implement your own Init(), | ||
Update() and Draw() logic. | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using Microsoft.Xna.Framework; | ||
using PixelVision8.Engine; | ||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class CalculateDistanceExample : GameChip | ||
{ | ||
private Point pointA = new Point(8, 8); | ||
private Point pointB = new Point(248, 232); | ||
private Canvas canvas; | ||
private int distance; | ||
|
||
public override void Init() | ||
{ | ||
|
||
// Create a new canvas and pass this GameChip into the constructor | ||
canvas = new Canvas(256, 240, this); | ||
|
||
// Set the canvas stroke to a white 1x1 pixel brush | ||
canvas.SetStroke(new[] { 15 }, 1, 1); | ||
|
||
} | ||
|
||
public override void Update(int timeDelta) | ||
{ | ||
|
||
// Update position B with the MousePosition | ||
pointB = MousePosition(); | ||
|
||
// Calculate the distance between pointA and pointB | ||
distance = CalculateDistance(pointA.X, pointA.Y, pointB.X, pointB.X); | ||
|
||
} | ||
|
||
public override void Draw() | ||
{ | ||
|
||
// Redraw the display | ||
RedrawDisplay(); | ||
|
||
// Clear the canvas with the background color | ||
canvas.Clear(0); | ||
|
||
// Draw 2 circles around each point | ||
canvas.DrawCircle(pointA.X - 4, pointA.Y - 4, pointA.X + 4, pointA.Y + 4); | ||
canvas.DrawCircle(pointB.X - 4, pointB.Y - 4, pointB.X + 4, pointB.Y + 4); | ||
|
||
// Draw a line between the two points | ||
canvas.DrawLine(pointA.X, pointA.Y, pointB.X, pointB.Y); | ||
|
||
// Draw the distance value above pointB | ||
canvas.DrawText(distance.ToString(), pointB.X, pointB.Y - 12, "small", 15, -4); | ||
|
||
// Draw the canvas to the display | ||
canvas.DrawPixels(); | ||
|
||
} | ||
} | ||
} |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
Pixel Vision 8 - CalculateIndex Example | ||
Copyright(C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman(@jessefreeman) | ||
This project was designed to display some basic instructions when you create | ||
a new game.Simply delete the following code and implement your own Init(), | ||
Update() and Draw() logic. | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class CalculateIndexExample : GameChip | ||
{ | ||
|
||
// A 1D array of example values | ||
private string[] exampleGrid = | ||
{ | ||
"A", "B", "C", | ||
"D", "E", "F", | ||
"G", "H", "I", | ||
}; | ||
|
||
public override void Init() | ||
{ | ||
// Calculate the center index based on a grid with 3 columns | ||
var index = CalculateIndex(1, 1, 3); | ||
|
||
// Draw the index and value to the display | ||
DrawText("Position 1,1 is Index " + index + " is " + exampleGrid[index], 1, 1, DrawMode.Tile, "large", | ||
15); | ||
|
||
} | ||
|
||
public override void Draw() | ||
{ | ||
// Redraw the display | ||
RedrawDisplay(); | ||
} | ||
|
||
} | ||
} |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
Pixel Vision 8 - CalculatePosition Example | ||
Copyright(C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman(@jessefreeman) | ||
This project was designed to display some basic instructions when you create | ||
a new game.Simply delete the following code and implement your own Init(), | ||
Update() and Draw() logic. | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class CalculatePositionExample : GameChip | ||
{ | ||
// A 1D array of example values | ||
private string[] exampleGrid = | ||
{ | ||
"A", "B", "C", | ||
"D", "E", "F", | ||
"G", "H", "I", | ||
}; | ||
|
||
public override void Init() | ||
{ | ||
var index = 4; | ||
|
||
// Calculate the center index based on a grid with 3 columns | ||
var position = CalculatePosition(index, 3); | ||
|
||
// Draw the index and value to the display | ||
DrawText("Position " + position.X + "," + position.Y + " at Index " + index + " is " + exampleGrid[index], 1, 1, DrawMode.Tile, "large", 15); | ||
|
||
} | ||
|
||
public override void Draw() | ||
{ | ||
// Redraw the display | ||
RedrawDisplay(); | ||
} | ||
|
||
} | ||
} |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Oops, something went wrong.
Empty file.
Oops, something went wrong.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
Pixel Vision 8 - CharacterToPixelData Example | ||
Copyright(C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman(@jessefreeman) | ||
This project was designed to display some basic instructions when you create | ||
a new game.Simply delete the following code and implement your own Init(), | ||
Update() and Draw() logic. | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class CharacterToPixelDataExample : GameChip | ||
{ | ||
|
||
private int[] pixelData; | ||
|
||
public override void Init() | ||
{ | ||
|
||
// Get the raw pixel data for the A character | ||
pixelData = CharacterToPixelData('A', "large"); | ||
|
||
// Loop through all of the pixels | ||
for (int i = 0; i < pixelData.Length; i++) | ||
{ | ||
|
||
// Test to see if the pixel is set to the color ID 0 | ||
if (pixelData[i] == 0) | ||
{ | ||
|
||
// Change the color ID to 14 | ||
pixelData[i] = 14; | ||
|
||
} | ||
|
||
} | ||
|
||
} | ||
|
||
public override void Draw() | ||
{ | ||
|
||
// Redraw display | ||
RedrawDisplay(); | ||
|
||
// Use the normal DrawText() API to display the A | ||
DrawText("A", 8, 8, DrawMode.Sprite, "large", 15); | ||
|
||
// Draw the pixel data to the display next to the A | ||
DrawPixels(pixelData, 16, 8, 8, 8); | ||
|
||
} | ||
} | ||
} |
Empty file.
Oops, something went wrong.
Empty file.
Empty file.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
Pixel Vision 8 - Clamp Example | ||
Copyright(C) 2017, Pixel Vision 8 (http://pixelvision8.com) | ||
Created by Jesse Freeman(@jessefreeman) | ||
This project was designed to display some basic instructions when you create | ||
a new game.Simply delete the following code and implement your own Init(), | ||
Update() and Draw() logic. | ||
Learn more about making Pixel Vision 8 games at | ||
https://www.pixelvision8.com/getting-started | ||
**/ | ||
|
||
using PixelVision8.Engine.Chips; | ||
|
||
namespace PixelVision8.Examples | ||
{ | ||
class ClampExample : GameChip | ||
{ | ||
|
||
private int counter; | ||
private int time; | ||
private int delay = 300; | ||
|
||
public override void Update(int timeDelta) | ||
{ | ||
// Add the time delay to the time | ||
time = time + timeDelta; | ||
|
||
// Check if time is greater than the delay | ||
if (time > delay) | ||
{ | ||
|
||
// Increase the counter by 1 | ||
counter = Clamp(counter + 1, 0, 10); | ||
|
||
// Reset the time | ||
time = 0; | ||
|
||
} | ||
} | ||
|
||
public override void Draw() | ||
{ | ||
|
||
// Redraw the display | ||
RedrawDisplay(); | ||
|
||
// Draw the counter to the display | ||
DrawText("Counter " + counter, 8, 8, DrawMode.Sprite, "large", 15); | ||
|
||
} | ||
|
||
} | ||
} |
Empty file.
Oops, something went wrong.
Empty file.
Empty file.
Oops, something went wrong.
Oops, something went wrong.