Skip to content

Commit

Permalink
more games
Browse files Browse the repository at this point in the history
still v3.
  • Loading branch information
D3ch committed Oct 4, 2023
1 parent ed1dc85 commit 096a2ec
Show file tree
Hide file tree
Showing 70 changed files with 22,361 additions and 1 deletion.
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/SFX_Jump_11.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/SFX_Jump_17.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/SFX_Jump_22.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/SFX_Jump_24.ogg
Binary file not shown.
4,606 changes: 4,606 additions & 0 deletions Games/chainsaw-dance/html5game/benedance.js

Large diffs are not rendered by default.

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 added Games/chainsaw-dance/html5game/chainsawvance.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/click_short1.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/e_hit.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/e_long_note.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/effect_goal.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/final_result.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/s_one.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/s_sob.ogg
Binary file not shown.
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/score_count.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_ambient.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_bad_result.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_bug_thif.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_chain.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_countdown.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_fail.ogg
Binary file not shown.
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_result_hit.ogg
Binary file not shown.
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_score_tick.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_start.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_thunder.ogg
Binary file not shown.
Binary file added Games/chainsaw-dance/html5game/snd_victory.ogg
Binary file not shown.
2,754 changes: 2,754 additions & 0 deletions Games/chainsaw-dance/html5game/tph_newgroundsio.js

Large diffs are not rendered by default.

263 changes: 263 additions & 0 deletions Games/chainsaw-dance/html5game/uph_ng_library.js
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");});
}

5 changes: 5 additions & 0 deletions Games/chainsaw-dance/html5game/wph_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

function geturl() {
var chref = document.location.href;
return chref;
}
65 changes: 65 additions & 0 deletions Games/chainsaw-dance/html5game/xph_js.js
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;
}
Loading

2 comments on commit 096a2ec

@vercel
Copy link

@vercel vercel bot commented on 096a2ec Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 096a2ec Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.