-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The only backward incompatible change in this version is the change in the SharkG for loop from a C like loop (for x: int = 0, x < y, x++ do ...) to a range based style (for x to y do ...). Many bugfixes and small improvements on the android, flash and HTML5 ports of Shark and SharkG,
- Loading branch information
1 parent
3f7dd33
commit e0a76d2
Showing
136 changed files
with
2,527 additions
and
272 deletions.
There are no files selected for viewing
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
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,33 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
import "shark/asset.api" | ||
import "shark/event.api" | ||
import "shark/font.api" | ||
import "shark/main.api" | ||
import "shark/persistent.api" | ||
import "shark/screen.api" | ||
import "shark/texture.api" |
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 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
import "shark/texture.api" | ||
import "shark/font.api" | ||
|
||
# signals that an asset was not found | ||
var ERR_ASSET_NOT_FOUND: int | ||
|
||
# loads the texture 'path' relative to the /asset directory | ||
function load_texture(path: str) -> texture | ||
|
||
# loads the font 'path' relative to the /asset directory | ||
function load_font(path: str, size: int, color: int) -> font |
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,58 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
# numeric constant codes for input event types | ||
# see the prototype of 'event' in shark/main.api | ||
|
||
# no event | ||
# never used in practice | ||
var E_NONE: int | ||
|
||
# signals pressing, moving and releasing of the single touch display/mouse | ||
# when recieving one of these, the 'x' and 'y' arguments are the absolute screen location of the event | ||
var E_PRESS: int | ||
var E_MOVE: int | ||
var E_RELEASE: int | ||
|
||
# signals pressing and releasing analogic buttons | ||
# UP, DOWN, LEFT and RIGHT are the D-Pad | ||
# X and Y are usually the Accept and Cancel buttons (but you can use them for whatever you want) | ||
var E_PRESS_UP: int | ||
var E_PRESS_DOWN: int | ||
var E_PRESS_LEFT: int | ||
var E_PRESS_RIGHT: int | ||
var E_PRESS_X: int | ||
var E_PRESS_Y: int | ||
var E_REL_UP: int | ||
var E_REL_DOWN: int | ||
var E_REL_LEFT: int | ||
var E_REL_RIGHT: int | ||
var E_REL_X: int | ||
var E_REL_Y: int | ||
|
||
# NOTE: It's important (unless you're making a game for certain platforms only) that | ||
# a game can interact with the user using both the touch screen and analogic buttons | ||
# as some platforms will only provide one of the two. |
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,34 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
# a font used to render text | ||
# fonts are created with the load_font call from shark/asset.api | ||
class font (object) | ||
# frees this font | ||
function free() | ||
|
||
# gets the height (point size) of this font | ||
function get_height() |
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,41 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
# this file contains the prototypes of the main functions that compose a game | ||
# you have to implement all of them to have a working game | ||
|
||
# called on game start to intialize its state | ||
function launch() | ||
|
||
# called on each event with the event information | ||
# 'type' is the event type, 'x' and 'y' are the screen coordinates of the event | ||
function event(type: int, x: int, y: int) | ||
|
||
# called on each game cycle to update the game's state | ||
function update() | ||
|
||
# called on each game cycle to render the game on screen | ||
function render() |
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,32 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
import "system/io.api" | ||
|
||
# gets the save file for this application | ||
# mode can be 'w' for writing or 'r' for reading | ||
# if 'r' mode is requested and no save data is available null is returned | ||
function get_save_file(mode: char) -> 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,41 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
import "shark/texture.api" | ||
import "shark/font.api" | ||
|
||
# Draws the texture 'text' into the screen at position x, y. | ||
# The drawing is done by taking the x and y argument and drawing the given texture by placing its top-left corner at the x, y position. | ||
function draw(text: texture, x: int, y: int) | ||
|
||
# Draws the texture 'text' into the screen applying the given transformations. | ||
# The texture is drawn centered at (x, y), position is computed by adding origin_x and origin_y coordinates to the center of the texture, rotating it rotation degrees clockwise and scaling it by the (scale_x, scale_y) vector. | ||
function draw_ex(text: texture, x: int, y: int, | ||
origin_x: int, origin_y: int, | ||
rotation: float, scale_x: float, scale_y: float) | ||
|
||
# Draws the text string 'text' using the given font into the screen at position x, y. | ||
function draw_text(text: str, font_object: font, x: int, y: int) |
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 @@ | ||
############################################################################### | ||
### Copyright ################################################################## | ||
## | ||
## Copyright 2022 Daniel Alvarez <shogundevel@gmail.com> | ||
## | ||
## Permission is hereby granted, free of charge, to any person | ||
## obtaining a copy of this software and associated documentation files | ||
## (the "Software"), to deal in the Software without restriction, | ||
## including without limitation the rights to use, copy, modify, merge, | ||
## publish, distribute, sublicense, and/or sell copies of the Software, | ||
## and to permit persons to whom the Software is furnished to do so, | ||
## subject to the following conditions: | ||
## | ||
## The above copyright notice and this permission notice shall be | ||
## included in all copies or substantial portions of the Software. | ||
## | ||
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## | ||
################################################################################ | ||
|
||
# a texture that can be drawn into the screen | ||
# textures are created with the load_texture call from shark/asset.api | ||
class texture (object) | ||
# frees this texture | ||
function free() | ||
|
||
# gets the width of this texture | ||
function get_size_x() -> int | ||
|
||
# gets the height of this texture | ||
function get_size_y() -> int |
Oops, something went wrong.