Rpg fail

Developer
Size
3,874 Kb
Views
2,024

How do I make an rpg fail?

What is a rpg fail? How do you make a rpg fail? This script and codes were developed by Brosis Mosis on 30 January 2023, Monday.

Rpg fail Previews

Rpg fail - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rpg fail</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="map"> <div class="first-plan" style="position: absolute; width: 640px; z-index:1;"></div> <div class="second-plan" style="position: absolute; width: 640px; z-index:2;"></div>
<div class="char-area" style="position: absolute; width: 640px; z-index:3;"> <div class='char'></div> </div> <div class="third-plan" style="position: absolute; width: 640px; z-index:4;"></div> <div class="fourth-plan" style="position: absolute; width: 640px; z-index:5;"></div>
</div>
<div class='btnTileset'>Show Tile set </div>
<div id="tileset"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Rpg fail - Script Codes CSS Codes

.map { position: aboslute; margin: 0 auto;}
.btnTileset { border: 1px solid black; width: 120px; height:30px; text-align:center; line-height:30px; margin-top: 10px; background: #6eaa5c; color: white; position: absolute; top: 0;}
.btnTileset:hover { cursor: pointer;}
#tileset {width: 256px; height:12000px; background: url(http://fc03.deviantart.net/fs26/i/2008/149/d/7/rpg_maker_xp_the_best_tileset_by_davide_86.png); display:none; margin: 0 auto; position: absolute; top: 45px;}

Rpg fail - Script Codes JS Codes

for (var i = 0; i < 3000; i++) { $('div#tileset').append("<div style='width: 30px; height: 30px; border: 1px solid red; float: left; font-size: 11px; text-shadow: 1px 1px 1px white;'>" + i + "</div>");
}
$('.btnTileset').click(function() { $('#tileset').toggle(500);
});
//////////////////////////////////////////
var map = { 'width': 640, 'height': 640, 'slotSize': 32, 'bg': 'green', 'tileset': 'http://fc03.deviantart.net/fs26/i/2008/149/d/7/rpg_maker_xp_the_best_tileset_by_davide_86.png', 'colision': [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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0, 0], //17 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //18 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], //19 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] //20 ], 'firstPlan': [ [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //1 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //2 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //3 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //4 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //5 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //6 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //7 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //8 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //9 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //10 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //11 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //12 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //13 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //14 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //15 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //16 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //17 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //18 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], //19 [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25] //20 ], 'secondPlan': [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 182, 1, 13, 5, 30], //1 [0, 9, 0, 0, 0, 0, 158, 0, 0, 0, 158, 0, 0, 0, 0, 0, 13, 13, 5, 5], //2 [0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 13, 13, 13], //3 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 21], //4 [0, 158, 0, 0, 9, 0, 0, 23, 0, 0, 0, 0, 150, 0, 0, 0, 2, 21, 3, 1], //5 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //6 [0, 0, 23, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 158, 0, 0, 0], //7 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //8 [0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //9 [0, 158, 0, 0, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, 0], //10 [0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 0, 158, 0, 0, 0], //11 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //12 [0, 0, 0, 0, 0, 158, 0, 173, 174, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0], //13 [0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0], //14 [0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0], //15 [0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0], //16 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 162, 0, 0, 0, 0, 0], //17 [0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0], //18 [0, 9, 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, 72, 73, 74, 75], //19 [0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, 150, 0, 0, 163, 0, 0] //20 ], 'thirdPlan': [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //1 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //2 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //3 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //4 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //5 [0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //18 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //19 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] //20 ]
};
$('.map').css({ 'width': map.width, 'height': map.height, 'background': map.bg
});
function planMaker(selector) { for ($i = 0; $i < map.colision.length; $i++) { for ($j = 0; $j < map.colision[0].length; $j++) { if (selector === ".first-plan") { var bg = map.firstPlan[$i][$j]; } else if (selector === ".second-plan") { var bg = map.secondPlan[$i][$j]; } else if (selector === ".third-plan") { var bg = map.thirdPlan[$i][$j]; } else if (selector === ".fourth-plan") { var bg = map.thirdPlan[$i][$j]; } if (bg != 0) { $bgy = bg > 8 ? Math.floor((bg / 8)) * map.slotSize : 0; $bgx = bg > 8 ? (bg % 8) * map.slotSize : bg * map.slotSize; $(selector).append("<div style='width: 32px; height: 32px; float: left; background: url(" + map.tileset + ")" + (-$bgx + "px" + " " + -$bgy + "px") + ";' name='" + $i + $j + " '></div>"); } else { $(selector).append("<div style='width: 32px; height: 32px; float: left;'></div>"); } } }
}
planMaker(".first-plan");
planMaker(".second-plan");
planMaker(".third-plan");
planMaker(".fourth-plan");
//////////////////////////////////////////////////////
var char = { 'id': '*', 'width': 32, 'height': 45, 'step': 32, 'bg': 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSHoYYjSQB0rVhpjsTftijZceE4yCH1fuyNHws-hVT0hO6Ko_tA', 'speed': 250, 'position': [3, 1]
};
$positionY = char.position[0];
$positionX = char.position[1];
$char = $('.char');
$char.css({ 'width': char.width, 'height': char.height, 'position': 'absolute', 'left': char.step * $positionX, 'top': char.step * $positionY, 'marginTop': -char.height + (map.slotSize / 2), 'backgroundImage': 'url(' + char.bg + ')'
});
function charPosition() { for ($i = 0; $i < map.colision.length; $i++) { for ($j = 0; $j < map.colision[0].length; $j++) { if (map.colision[$i][$j] == '*') { $('.char-position').html("[ Y: " + $i + " ]" + "[ X: " + $j + " ]"); } } }
}
function charSprite(spriteY) { $char.css({ 'backgroundPosition': '-96px ' + spriteY, }); setTimeout(function() { $char.css({ 'backgroundPosition': '-64px ' + spriteY, }); }, 50); setTimeout(function() { $char.css({ 'backgroundPosition': '-32px ' + spriteY, }); }, 100); setTimeout(function() { $char.css({ 'backgroundPosition': '-0px ' + spriteY, }); }, 150);
}
$('body').keydown(function(e) { e.preventDefault(); var $key = e.which; if ($key == 39 && ($char.is(':animated') === false)) { if (map.colision[$positionY][$positionX + 1] === 0) { map.colision[$positionY][$positionX] = 0; $positionX = ++$positionX; map.colision[$positionY][$positionX] = char.id; $char.animate({ 'marginLeft': '-=' + -char.step, }, char.speed); charSprite('-98px'); charPosition(); } } else if ($key == 37 && ($char.is(':animated') === false)) { if (map.colision[$positionY][$positionX - 1] === 0) { map.colision[$positionY][$positionX] = 0; $positionX = --$positionX; map.colision[$positionY][$positionX] = char.id; $char.animate({ 'marginLeft': '+=' + -char.step, }, char.speed); charSprite('-50px'); charPosition(); } } else if ($key == 38 && ($char.is(':animated') === false)) { if (map.colision[$positionY - 1][$positionX] === 0) { map.colision[$positionY][$positionX] = 0; $positionY = --$positionY; map.colision[$positionY][$positionX] = char.id; $char.animate({ 'marginTop': '+=' + -char.step, }, char.speed); charSprite('-146px'); charPosition(); } } else if ($key == 40 && ($char.is(':animated') === false)) { if (map.colision[$positionY + 1][$positionX] === 0) { map.colision[$positionY][$positionX] = 0; $positionY = ++$positionY; map.colision[$positionY][$positionX] = char.id; $char.animate({ 'marginTop': '-=' + -char.step, }, char.speed); charSprite('0px'); charPosition(); } }
});
Rpg fail - Script Codes
Rpg fail - Script Codes
Home Page Home
Developer Brosis Mosis
Username kermet24
Uploaded January 30, 2023
Rating 3
Size 3,874 Kb
Views 2,024
Do you need developer help for Rpg fail?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Brosis Mosis (kermet24) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!