Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
digivorix committed May 25, 2023
0 parents commit d6631a8
Show file tree
Hide file tree
Showing 20 changed files with 1,543 additions and 0 deletions.
Binary file added BasicPlatformer.mfa
Binary file not shown.
134 changes: 134 additions & 0 deletions BasicPlatformer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="en">

<style type="text/css">
h1 {
font-family: Arial, Helvetica, sans-serif;
color: #F00;
font-size: x-large;
}
p {
font-family: Arial, Helvetica, sans-serif;
color: #000;
font-size: small;
}
body {
background-color: #FFF;
text-align: center;
margin: 0;
padding: 0;
}
#bloctxt {
border-left-width: 5px;
border-left-style: solid;
border-left-color: #F00;
padding-left: 10px;
position: absolute;
left: 50%%;
width: 600px;
margin-left: -260px
}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<!-- Enables full-screen on iOS devices -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="HandheldFriendly" content="true" />

<title>Basic Platformer</title>

<script>
// Detection of old browsers that do not support the canvas element
// Falls back to a default page
if (!document.createElement("canvas").getContext)
{
window.open("http://www.clickteam.com/html5-fallback", "_self");
}
</script>


<!-- EXTRASOURCES -->
<!-- Loads the Javascript code...-->
<script src="src/Runtime.js"></script>
<script src=newgrounds.js></script>
<script>

"use strict";

var appID = "null";
var encryptionCipher = "null"; // AES-128 Base64
var debug = 0;

function setAppID(newID){
appID = newID;
}

function setCipher(newCipher){
encryptionCipher = newCipher;
}

function setDebug(newDebug){
debug = newDebug;
}

function startNewgrounds(){
Newgrounds.Init(appID, encryptionCipher, debug);
}

function unlockMedal(id)
{
Newgrounds.UnlockMedal(id);
}

function postScore(id, score)
{
Newgrounds.PostScore(id, parseInt(input_score.value));
}

</script>

<script>

// Detection of when the html file is ran locally.
// You can remove this code for the final version
if (window.location.protocol == "file:")
{
document.write('<div id="bloctxt">');
document.write('<h1>The application cannot be run...</h1>');
document.write('<p>HTML browsers do not allow you to launch data files directly from the file system.<br>');
document.write('A drag & drop of the html file on a web-browser window will not work, on any machine.<br>');
document.write('Please use the Build & Run option (it opens a local web server) to run your application,<br>')
document.write('or upload your application folder to a remote web-server, and start it from there...</p>');
document.write('</div>');
throw new error("Cannot run application");
}
</script>
</head>

<body>

<div style="display: inline-block; -webkit-user-select: none; text-align: left;">
<canvas id="MMFCanvas" width="640" height="352">
Your browser does not support Canvas.
</canvas>
</div>

<script>
// RUNTIMESTART
// This is where the HTML5 runtime is actually started
window.addEventListener("load", windowLoaded, false);
function windowLoaded()
{
// Calls the runtime
// First parameter : name of the canvas element
// Second parameter : path to the cch file. Images and sounds must lay beside this file
new Runtime("MMFCanvas", "resources/BasicPlatformer.cch");
}
// RUNTIMESTARTEND
</script>

</body>
</html>
219 changes: 219 additions & 0 deletions BasicPlatformer/newgrounds.js

Large diffs are not rendered by default.

Binary file added BasicPlatformer/resources/0000.mp3
Binary file not shown.
Binary file added BasicPlatformer/resources/0000.ogg
Binary file not shown.
Binary file added BasicPlatformer/resources/0001.mp3
Binary file not shown.
Binary file added BasicPlatformer/resources/0001.ogg
Binary file not shown.
Binary file added BasicPlatformer/resources/0002.mp3
Binary file not shown.
Binary file added BasicPlatformer/resources/0002.ogg
Binary file not shown.
Binary file added BasicPlatformer/resources/0003.mp3
Binary file not shown.
Binary file added BasicPlatformer/resources/0003.ogg
Binary file not shown.
Binary file added BasicPlatformer/resources/9999.mp3
Binary file not shown.
Binary file added BasicPlatformer/resources/BasicPlatformer.cc1
Binary file not shown.
Binary file added BasicPlatformer/resources/BasicPlatformer.cch
Binary file not shown.
Binary file added BasicPlatformer/resources/M0001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
918 changes: 918 additions & 0 deletions BasicPlatformer/src/Runtime.js

Large diffs are not rendered by default.

Binary file added Newgrounds_API.pdf
Binary file not shown.
17 changes: 17 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-Newgrounds.io API for Clickteam Fusion 2.5-


This is a wrapper that makes use of a Javascript version of the Newgrounds API that was written by KilledByAPixel.



To get started, read the included Newgrounds_API.pdf file. This contains information on the wrapper and how to set it up inside of Clickteam Fusion.


BasicPlatformer.mfa is a small example which shows the API in action. Be sure to reference it if you are stuck.



This implimentation will work with any version of Clickteam Fusion 2.5 (Free, Standard, or Developer).

NOTE: If you have Fusion 2.5 Standard or Developer, you will need the HTML5 Export Module, since it contains the HTML5 object. The free version of the exporter that is bundled with Fusion will work as well.
36 changes: 36 additions & 0 deletions code_insert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script src=newgrounds.js></script>
<script>

"use strict";

var appID = "null";
var encryptionCipher = "null"; // AES-128 Base64
var debug = 0;

function setAppID(newID){
appID = newID;
}

function setCipher(newCipher){
encryptionCipher = newCipher;
}

function setDebug(newDebug){
debug = newDebug;
}

function startNewgrounds(){
Newgrounds.Init(appID, encryptionCipher, debug);
}

function unlockMedal(id)
{
Newgrounds.UnlockMedal(id);
}

function postScore(id, score)
{
Newgrounds.PostScore(id, parseInt(input_score.value));
}

</script>

0 comments on commit d6631a8

Please sign in to comment.