Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Added API examples and migrated to net core.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 20, 2020
1 parent 052de2b commit e98a582
Show file tree
Hide file tree
Showing 1,184 changed files with 26,393 additions and 2,444 deletions.
29 changes: 29 additions & 0 deletions Disks/APIExamples/AddScript/code.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--[[
Pixel Vision 8 - AddScript 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
]]--

-- Create Lua code as a string
local textFile =
[===[
function test()
DrawText("Hello World", 1, 1, DrawMode.Tile, "large", 15)
end
]===]

-- Register the text file as a script
AddScript("textFile", textFile)

function Init()
-- Call the text method
test()
end

function Draw()
-- Redraw the display
RedrawDisplay()
end
Binary file added Disks/APIExamples/AddScript/colors.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions Disks/APIExamples/AddScript/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"ColorChip":
{
"total": 16,
"maxColors": 128,
"backgroundColor": 0,
"maskColor": "#FF00FF",
"unique": false,
"debug": false,

},
"DisplayChip":
{
"width": 264,
"height": 248,
"overscanX": 1,
"overscanY": 1,
"layers": 6

},
"FontChip":
{
},
"GameChip":
{
"lockSpecs": false,
"maxSize": 512,
"saveSlots": 8
},
"MusicChip":
{
"totalSongs": 32,
"notesPerTrack": 127,
"totalPatterns": 24,
"totalLoop": 24
},
"SoundChip":
{
"totalChannels": 5,
"totalSounds": 32,
"channelTypes": [-1, -1, -1, -1, -1]
},

"SpriteChip": {
"maxSpriteCount": 0,
"unique": false,
"spriteWidth": 8,
"spriteHeight": 8,
"pages": 8,
"cps": 8
},
"TilemapChip":
{
"columns": 256,
"rows": 256,
"totalFlags": 16,
"autoImport": false,

}
}
10 changes: 10 additions & 0 deletions Disks/APIExamples/AddScript/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "PV8System",
"description": "A PV8 Game Template.",
"version": "v0.9.4",
"ext": ".pv8",
"gpuChip": "PV8",
"cartChip": "PV8",
"soundChip": "PV8",

}
Binary file added Disks/APIExamples/AddScript/large.font.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Disks/APIExamples/AddScript/saves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{

"GameChip":
{
"savedData":{

}
}
}
29 changes: 29 additions & 0 deletions Disks/APIExamples/BackgroundColor/code.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--[[
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
]]--

function Init()

-- Get the current background color
local 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
local newColor = BackgroundColor(2)

-- Draw the new color ID to the display
DrawText("New Color " .. newColor, 1, 3, DrawMode.Tile, "large", 15)

end

function Draw()
-- Redraw the display
RedrawDisplay()
end
Binary file added Disks/APIExamples/BackgroundColor/colors.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions Disks/APIExamples/BackgroundColor/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"ColorChip":
{
"total": 16,
"maxColors": 128,
"backgroundColor": 0,
"maskColor": "#FF00FF",
"unique": false,
"debug": false,

},
"DisplayChip":
{
"width": 264,
"height": 248,
"overscanX": 1,
"overscanY": 1,
"layers": 6

},
"FontChip":
{
},
"GameChip":
{
"lockSpecs": false,
"maxSize": 512,
"saveSlots": 8
},
"MusicChip":
{
"totalSongs": 32,
"notesPerTrack": 127,
"totalPatterns": 24,
"totalLoop": 24
},
"SoundChip":
{
"totalChannels": 5,
"totalSounds": 32,
"channelTypes": [-1, -1, -1, -1, -1]
},

"SpriteChip": {
"maxSpriteCount": 0,
"unique": false,
"spriteWidth": 8,
"spriteHeight": 8,
"pages": 8,
"cps": 8
},
"TilemapChip":
{
"columns": 256,
"rows": 256,
"totalFlags": 16,
"autoImport": false,

}
}
10 changes: 10 additions & 0 deletions Disks/APIExamples/BackgroundColor/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "PV8System",
"description": "A PV8 Game Template.",
"version": "v0.9.4",
"ext": ".pv8",
"gpuChip": "PV8",
"cartChip": "PV8",
"soundChip": "PV8",

}
Binary file added Disks/APIExamples/BackgroundColor/large.font.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Disks/APIExamples/BackgroundColor/saves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{

"GameChip":
{
"savedData":{

}
}
}
51 changes: 51 additions & 0 deletions Disks/APIExamples/Button/code.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--[[
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
]]--

-- This array will store any buttons pressed during the current frame
local pressedButtons = {}

-- A list of all the buttons to check on each frame
local buttons = {
Buttons.Up,
Buttons.Down,
Buttons.Left,
Buttons.Right,
Buttons.A,
Buttons.B,
Buttons.Select,
Buttons.Start
}

function Update(timeDelta)

-- Clear the pressedButtons array on each frame
pressedButtons = {}

-- Loop through all the buttons
for i = 1, #buttons do

-- Test if player 1's current button is down and save it to the pressedButtons array
if(Button(buttons[i], InputState.Down, 0)) then
table.insert(pressedButtons, tostring(buttons[i]))
end
end

end

function Draw()

-- Clear the display
Clear()

-- Convert the pressedButtons into a string and draw to the display
local message = table.concat(pressedButtons, ", "):upper()
DrawText("Buttons Down:", 8, 8, DrawMode.Sprite, "large", 15)
DrawText(message:sub(0, #message), 8, 16, DrawMode.Sprite, "medium", 14, - 4)

end
Binary file added Disks/APIExamples/Button/colors.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions Disks/APIExamples/Button/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"ColorChip":
{
"total": 16,
"maxColors": 128,
"backgroundColor": 0,
"maskColor": "#FF00FF",
"unique": false,
"debug": false,

},
"DisplayChip":
{
"width": 264,
"height": 248,
"overscanX": 1,
"overscanY": 1,
"layers": 6

},
"FontChip":
{
},
"GameChip":
{
"lockSpecs": false,
"maxSize": 512,
"saveSlots": 8
},
"MusicChip":
{
"totalSongs": 32,
"notesPerTrack": 127,
"totalPatterns": 24,
"totalLoop": 24
},
"SoundChip":
{
"totalChannels": 5,
"totalSounds": 32,
"channelTypes": [-1, -1, -1, -1, -1]
},

"SpriteChip": {
"maxSpriteCount": 0,
"unique": false,
"spriteWidth": 8,
"spriteHeight": 8,
"pages": 8,
"cps": 8
},
"TilemapChip":
{
"columns": 256,
"rows": 256,
"totalFlags": 16,
"autoImport": false,

}
}
10 changes: 10 additions & 0 deletions Disks/APIExamples/Button/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "PV8System",
"description": "A PV8 Game Template.",
"version": "v0.9.4",
"ext": ".pv8",
"gpuChip": "PV8",
"cartChip": "PV8",
"soundChip": "PV8",

}
Binary file added Disks/APIExamples/Button/large.font.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Disks/APIExamples/Button/medium.font.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Disks/APIExamples/Button/saves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{

"GameChip":
{
"savedData":{

}
}
}

0 comments on commit e98a582

Please sign in to comment.