-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
still v3.
- Loading branch information
Showing
70 changed files
with
22,361 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2,754 changes: 2,754 additions & 0 deletions
2,754
Games/chainsaw-dance/html5game/tph_newgroundsio.js
Large diffs are not rendered by default.
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,263 @@ | ||
|
||
var ngio; | ||
function ng_connect(app_id, encryption_key){ | ||
ngio = new Newgrounds.io.core(app_id, encryption_key); | ||
} | ||
|
||
|
||
|
||
/* medal vars */ | ||
var medals, scoreboards; | ||
var medalDOM = document.createElement("div"); | ||
|
||
/* handle loaded medals */ | ||
function onMedalsLoaded(result) { | ||
if (result.success) medals = result.medals; | ||
} | ||
|
||
/* handle loaded scores */ | ||
function onScoreboardsLoaded(result) { | ||
if (result.success) scoreboards = result.scoreboards; | ||
console.log(scoreboards); | ||
} | ||
|
||
|
||
function ng_initialize(){ | ||
|
||
/*load medals and scoreboards from the server */ | ||
ngio.queueComponent("ScoreBoard.getBoards", {}, onScoreboardsLoaded); | ||
ngio.queueComponent("Medal.getList", {}, onMedalsLoaded); | ||
ngio.executeQueue(); | ||
|
||
/* setup medalcarrier */ | ||
_createMedalUI(); | ||
|
||
} | ||
|
||
/* load our medals from the server */ | ||
var _loadMedals = function(){ | ||
ngio.queueComponent("Medal.getList", {}, onMedalsLoaded); | ||
ngio.executeQueue(); | ||
} | ||
|
||
var _createMedalUI = function(){ | ||
|
||
// Creates the DOM with a medal carrier that is supposed to resemble the newgrounds version | ||
document.body.appendChild(medalDOM); | ||
medalDOM.innerHTML = | ||
"<div id='medal_container' style="+ | ||
"'position:absolute; "+ | ||
"background-color: rgb(5, 6, 9);"+ | ||
"border: 7px solid rgb(185, 163, 105);"+ | ||
"width:270px; "+ | ||
"height:70px; "+ | ||
"top: 51px; "+ | ||
"left: -310px; "+ | ||
"overflow:hidden; "+ | ||
"-webkit-transition:left 0.5s ease;"+ | ||
" -moz-transition:left 0.5s ease;"+ | ||
" -ms-transition:left 0.5s ease; "+ | ||
"-o-transition:left 0.5s ease;"+ | ||
"<div id = 'inner_medal' style = "+ | ||
"'left : -1px; "+ | ||
"position: relative;'>"+ | ||
"<div id = 'medal_icon' style = "+ | ||
"'background-color: rgb(5, 6, 9); "+ | ||
"border: 3.5px ridge rgb(57, 55, 61);"+ | ||
"width: 59px; "+ | ||
"height: 59px; "+ | ||
"left: 3px; "+ | ||
"top: 3px; "+ | ||
"position: relative;'>"+ | ||
"<img id = 'icon' style = "+ | ||
"'border: 3px solid "+ | ||
"rgb(57, 55, 61); "+ | ||
"width: 48px; "+ | ||
"height: 48px; "+ | ||
"left: 1px; "+ | ||
"top: 1px; "+ | ||
"position: relative;'"+ | ||
"src = ''>"+ | ||
"</div>"+ | ||
"<div id = 'medal_describer' style = "+ | ||
"'background-color: rgb(5, 6, 9); " + | ||
"border: 3.5px ridge rgb(57, 55, 61); "+ | ||
"width: 196px; "+ | ||
"height: 39px; "+ | ||
"left: 66px; "+ | ||
"top: -43px; "+ | ||
"position: relative;'>"+ | ||
"<div id = 'space' style = "+ | ||
"'background-color: rgb(39, 39, 47);"+ | ||
" width: 191px; "+ | ||
" height: 35px; "+ | ||
" line-height: 36px;"+ | ||
" text-align: center;"+ | ||
" left: 1px;"+ | ||
" top: 0px;"+ | ||
" position: relative; '> "+ | ||
"<span id = 'medal_description' style = "+ | ||
"'/*font*/"+ | ||
"font-family: arial;"+ | ||
"font-weight: 720;"+ | ||
"font-weight: 720;"+ | ||
"font-size : 12px;"+ | ||
" /*text*/"+ | ||
"letter-spacing: 0.5px;"+ | ||
"color: rgb(238, 240, 254);'> Sabooo"+ | ||
"</span>"+ | ||
"</div>"+ | ||
"</div>"+ | ||
"<div id = 'medal_headup' style ="+ | ||
"'background-color: rgb(5, 6, 9);"+ | ||
" border: 3.5px ridge rgb(57, 55, 61);"+ | ||
" width: 196px;"+ | ||
" height: 22px;"+ | ||
" left: 66px;"+ | ||
" top: -109px;"+ | ||
" position: relative;'>"+ | ||
" <div id = 'medal_feedback' style = "+ | ||
"' background-color: rgb(18, 15, 20);"+ | ||
" border: 2px solid rgb(39, 39, 47);" + | ||
" width: 187px;" + | ||
" height: 15px;"+ | ||
" line-height: 12px;"+ | ||
" left: 1px;"+ | ||
" top: 0px;"+ | ||
" position: relative;'>"+ | ||
"<span id= 'feedback' style = "+ | ||
"' /*font*/"+ | ||
"font-family: arial;"+ | ||
"font-weight: 750;"+ | ||
"font-size : 11px;"+ | ||
"/*text*/"+ | ||
"position: relative;"+ | ||
"left: 9px;"+ | ||
"text-transform: uppercase;"+ | ||
"letter-spacing: 0.5px;"+ | ||
" color: rgb(224, 192, 9);'>medal get!"+ | ||
"</span>"+ | ||
"<span id= 'medal_value' style = "+ | ||
"'/*font*/"+ | ||
"font-family: arial;"+ | ||
"font-weight: 720;"+ | ||
"font-size : 11px;"+ | ||
"/*text*/"+ | ||
"position: relative;"+ | ||
"left: 64px;"+ | ||
"letter-spacing: 0.5px;"+ | ||
"color: rgb(93, 93, 99);'>25pts"+ | ||
"</span>"+ | ||
" </div>"+ | ||
"</div>"+ | ||
"</div>"+ | ||
"</div>"; | ||
}; | ||
|
||
|
||
/*Displays the medal carrier on the screen by transitioning it on the screen | ||
and writes the medal details on the carrier */ | ||
var _showMedal = function(medal){ | ||
|
||
var medal_container = document.getElementById('medal_container'); | ||
medal_container.style.left = '10px'; | ||
setTimeout(function(){ | ||
medal_container.style.left = '-310px'; | ||
},2000); | ||
|
||
document.getElementById('icon').src = medal.icon; | ||
document.getElementById('medal_description').innerHTML = medal.name; | ||
var points = ["bogus", "5", "10", "25", "50", "100"]; | ||
document.getElementById('medal_value').innerHTML = points[medal.difficulty] + "pts"; | ||
}; | ||
|
||
|
||
var to_unlock = [] | ||
|
||
function ng_unlockmedal(medal_name) { | ||
|
||
|
||
/* If there is no user attached to our ngio object, it means the user isn't logged in and we can't post anything */ | ||
// if (!ngio.user) return; | ||
|
||
|
||
for (var i = 0; i < medals.length; i++) { | ||
|
||
var medal = medals[i]; | ||
|
||
/* look for a matching medal name */ | ||
if (medal.name == medal_name) { | ||
|
||
// Unlock and display if it's not unlocked yet | ||
if(!medal.unlocked){ | ||
to_unlock.push(medal); | ||
console.log("LengthCXY: ", to_unlock.length); | ||
setTimeout(function(){ | ||
_showMedal(medal); | ||
_loadMedals(); | ||
to_unlock.pop(); | ||
/* unlock the medal from the server */ | ||
ngio.callComponent('Medal.unlock', {id:medal.id}, function(result) { | ||
|
||
console.log("Successfully unlocked: ", medal.name); | ||
|
||
}); | ||
}, | ||
|
||
2500 * (to_unlock.length - 1)); | ||
} | ||
|
||
// I use this return value inside gamemaker to play the audio effect at the right time | ||
var sfxTimeout = 2500 * (to_unlock.length - 1); | ||
if(medal.unlocked) sfxTimeout = -1; | ||
return sfxTimeout; | ||
} | ||
} | ||
} | ||
|
||
function ng_postScore(board_id, score_value) { | ||
|
||
var score; | ||
|
||
for (var i = 0; i < scoreboards.length; i++) { | ||
|
||
scoreboard = scoreboards[i]; | ||
if(board_id == scoreboard.id) | ||
ngio.callComponent('ScoreBoard.postScore', {id:scoreboard.id, value:score_value}); | ||
} | ||
} | ||
|
||
|
||
function ng_getUser() { | ||
return JSON.stringify(ngio.getCurrentUser()); | ||
} | ||
|
||
function ng_getUserName() { | ||
var cuser = ngio.user; | ||
if (cuser) | ||
return ngio.user.name; | ||
else | ||
return "guest"; | ||
} | ||
|
||
function ng_getSession() { | ||
return ngio.session_id; | ||
} | ||
|
||
login_code = -1; | ||
function ng_requestLogin() { | ||
login_code = -1; | ||
ngio.requestLogin( | ||
function() {login_code = 0;}, | ||
function() {login_code = 1;}, | ||
function() {login_code = 2;}); | ||
} | ||
|
||
function ng_requestCode() { | ||
return login_code; | ||
} | ||
|
||
function ng_checkSession() { | ||
ngio.getSessionLoader().checkSession(function() {console.log("checked");}); | ||
} | ||
|
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,5 @@ | ||
|
||
function geturl() { | ||
var chref = document.location.href; | ||
return chref; | ||
} |
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 @@ | ||
var dbcontainer = document.createElement("div"); | ||
var dbfiles = {files:[], status: false}; | ||
|
||
var _func_ignore_drop = (e) => {e.stopPropagation();e.preventDefault();}; | ||
var _func_event_move = (e) => { | ||
_func_ignore_drop(e); | ||
dbfiles.status = true; | ||
} | ||
var _func_event_remove = (e) => { | ||
dbfiles.status = false; | ||
} | ||
var _func_event_drop = (e) => { | ||
_func_ignore_drop(e); | ||
var dt = e.dataTransfer; | ||
var cfiles = dt.files; | ||
dbfiles.files = []; | ||
for (var i = 0; i < cfiles.length; i++) { | ||
var ourl = (window.URL || window.webkitURL).createObjectURL(cfiles[i]); | ||
dbfiles.files[i] = {link: ourl, name: cfiles[i].name}; | ||
} | ||
} | ||
|
||
|
||
function dbCreateDropbox(x, y, w, h) { | ||
document.body.appendChild(dbcontainer); | ||
dbcontainer.innerHTML = `<div id="dropbox" style=" | ||
top:` + x +`px; | ||
left:` + y + `px; | ||
width:` + w + `px; | ||
height:` + h +`px; | ||
color:red; | ||
position:absolute; | ||
">`; | ||
|
||
var dropbox; | ||
dropbox = document.getElementById("dropbox"); | ||
|
||
dropbox.addEventListener("dragenter", _func_event_move, false); | ||
dropbox.addEventListener("dragover", _func_ignore_drop, false); | ||
dropbox.addEventListener("dragleave", _func_event_remove, false); | ||
dropbox.addEventListener("drop", _func_event_drop, false); | ||
} | ||
|
||
function dbRemoveDropbox() { | ||
var dropbox; | ||
dropbox = document.getElementById("dropbox"); | ||
|
||
if (dropbox) { | ||
dbcontainer.removeChild(dropbox); | ||
} | ||
dbfiles.status = false; | ||
} | ||
|
||
function dbReturnFiles() { | ||
var cfiles = dbfiles.files; | ||
dbfiles.files = []; | ||
if (cfiles.length > 0) { | ||
dbfiles.status = false; | ||
} | ||
return JSON.stringify(cfiles); | ||
} | ||
|
||
function dbDropboxStatus() { | ||
return dbfiles.status; | ||
} |
Oops, something went wrong.
096a2ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hell – ./
hell-th3dach-gmailcom.vercel.app
hell-alpha.vercel.app
hell-git-main-th3dach-gmailcom.vercel.app
096a2ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hell-lzxk – ./
hell-lzxk.vercel.app
hell-lzxk-git-main-th3dach-gmailcom.vercel.app
hell-lzxk-th3dach-gmailcom.vercel.app