• VNOJ
  • Trang chủ
  • Danh sách bài
  • Các bài nộp
  • Thành viên
    >
    • Tổ chức
  • Các kỳ thi
  • Wiki
  • Thông tin
    >
    • FAQ
    • Trình chấm ngoài
    • Tag
    • Máy chấm
    • Devlog
    • Github
    • Tickets
    • Thư viện đề thi
    • Đề xuất contest
  • Tạp chí
VI EN Đăng nhập  hoặc  Đăng ký

petercon123

  • Thông tin
  • Thống kê
  • Blog

Số bài đã giải: 52
Hạng điểm: #5623
Tổng điểm: 12,28
Đóng góp: -11

Xem các bài nộp

Từ Trường Đại học Khoa học Tự nhiên - Đại học Quốc gia TP.HCM, Trường Đại học Quốc Tế - Đại học Quốc gia TP.HCM

Thông tin

Thk kid lord sv nhat vn: bấm vô đây <html lang="vi"> <head> <meta charset="UTF-8"> <title>GOD SLAYER: REBALANCED</title> <style> @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap'); body { margin: 0; overflow: hidden; background: #020202; font-family: 'Oswald', sans-serif; color: white; user-select: none; } canvas { display: block; filter: saturate(1.4) contrast(1.1); }

    /* Giao diện người chơi */
    #ui { position: fixed; top: 20px; left: 20px; pointer-events: none; z-index: 10; }
    .card { background: rgba(0,0,0,0.85); border-left: 5px solid #ffd700; padding: 15px; border-radius: 4px; width: 280px; box-shadow: 0 0 30px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); }

    .stat-row { font-size: 18px; margin-bottom: 10px; display: flex; justify-content: space-between; }
    .cd-container { margin-top: 8px; }
    .cd-label { font-size: 12px; color: #aaa; margin-bottom: 2px; display: flex; justify-content: space-between; }
    .cd-bg { height: 6px; background: #222; border-radius: 3px; overflow: hidden; width: 100%; }
    .cd-fill { height: 100%; width: 0%; transition: width 0.1s linear; }

    /* Giao diện Boss */
    #boss-ui { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 70%; text-align: center; z-index: 100; }
    .hp-bg { height: 12px; background: rgba(50,0,0,0.6); border-radius: 10px; overflow: hidden; margin-top: 10px; border: 1px solid #ff4444; box-shadow: 0 0 15px #f00; }
    #hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #600, #f00, #ff8888); transition: 0.2s; }

    #msg { position: fixed; top: 30%; width: 100%; text-align: center; font-size: 60px; font-weight: 900; opacity: 0; transition: .4s; pointer-events: none; text-shadow: 0 0 20px #000; }
</style>

</head> <body>

<div id="ui"> <div class="card"> <div id="wp-name" style="font-size:24px; font-weight:700; color: #fff; text-transform: uppercase;">THÁNH KIẾM</div> <div class="stat-row"><span>❤ HP:</span> <span id="p-hp" style="color:#0f0">5000</span></div>

    <div class="cd-container">
        <div class="cd-label"><span>[Z] LƯỚT</span><span id="txt-Z">READY</span></div>
        <div class="cd-bg"><div id="bar-Z" class="cd-fill" style="background:#fff"></div></div>
    </div>
    <div class="cd-container">
        <div class="cd-label"><span>[X] KỸ NĂNG</span><span id="txt-X">READY</span></div>
        <div class="cd-bg"><div id="bar-X" class="cd-fill" style="background:#0f0"></div></div>
    </div>
    <div class="cd-container">
        <div class="cd-label" style="color:#ffb300"><span>[C] ULTIMATE</span><span id="txt-C">READY</span></div>
        <div class="cd-bg"><div id="bar-C" class="cd-fill" style="background:#ffb300"></div></div>
    </div>
</div>

</div>

<div id="boss-ui"> <div id="boss-name" style="color:#ff4444; font-weight:700; font-size:24px; letter-spacing:10px; text-shadow: 0 0 10px #f00;">AZRAEL: THE TITAN</div> <div class="hp-bg"><div id="hp-fill"></div></div> </div>

<div id="msg">MESSAGE</div> <canvas id="game"></canvas>

<script> const canvas = document.getElementById("game"), ctx = canvas.getContext("2d"); canvas.width = window.innerWidth; canvas.height = window.innerHeight;

// CẤU HÌNH HỆ THỐNG const BOSSMAXHP = 10000000000; const CDTIME = { Z: 40, X: 150, C: 600 }; // Thời gian hồi chiêu (Frames) let player = { x: 0, y: 0, hp: 5000, wp: 0, cd: {Z:0, X:0, C:0}, invul: 0, ghost: [] }; let boss = { x: 1500, y: 0, hp: BOSSMAXHP, max: BOSSMAX_HP, size: 130, vx: 0, vy: 0, ai: 0, enrage: false }; let camX = 0, camY = 0, timeStop = 0, shake = 0, keys = {}; let bullets = [], bBullets = [], items = [], particles = [];

// CÂN BẰNG VŨ KHÍ (Nerf sát thương chiêu cuối) const WEAPONS = [ {name:"THÁNH KIẾM", color:"#fff", dmg:0.6e5, Z:()=>dash(500), X:()=>circleShot(60,25,"#fff",0.6e6), C:()=>aoe(player.x,player.y,500,"#fff",1e8)}, {name:"HỎA LONG", color:"#f40", dmg:1.5e5, Z:()=>dash(600), X:()=>rainFire(100), C:()=>aoe(boss.x,boss.y,700,"#f40",3e8)}, {name:"BĂNG THẦN", color:"#0ff", dmg:1.2e5, Z:()=>teleport(), X:()=>circleShot(80,22,"#0ff",0.8e6), C:()=>iceAge()}, {name:"HƯ KHÔNG", color:"#bc13fe", dmg:3e5, Z:()=>dash(800), X:()=>burst(150,35,"#bc13fe",1.5e6), C:()=>voidStorm()}, {name:"LONG PHÁO", color:"#ff0", dmg:1e6, Z:()=>divineBless(), X:()=>bigShot(50), C:()=>aoe(boss.x,boss.y,1000,"#fff",5e8)} ];

// UTILS const getA = () => Math.atan2(mouseY + camY - player.y, mouseX + camX - player.x); const spawnPart = (x,y,c,n=15) => { for(let i=0;i<n;i++) particles.push({x,y,vx:(Math.random()-0.5)20,vy:(Math.random()-0.5)20,s:Math.random()6,c,l:30}); }; const msg = (t,c="#fff") => { let m=document.getElementById("msg"); m.innerText=t; m.style.opacity=1; m.style.color=c; setTimeout(()=>m.style.opacity=0,1500); }; const aoe = (x,y,r,c,d) => { bullets.push({x,y,vx:0,vy:0,c,s:r,d:d,life:50,aoe:1}); spawnPart(x,y,c,60); shake = 30; }; const spawn = (x,y,a,v,c,d) => { bullets.push({x,y,vx:Math.cos(a)v,vy:Math.sin(a)*v,c,d:d,s:20}); };

// KỸ NĂNG function dash(dist) { player.invul=30; let a=getA(); for(let i=0;i<8;i++) player.ghost.push({x:player.x+Math.cos(a)dist(i/8),y:player.y+Math.sin(a)dist(i/8),l:20}); player.x+=Math.cos(a)dist; player.y+=Math.sin(a)dist; } function teleport() { player.x=mouseX+camX; player.y=mouseY+camY; player.invul=40; spawnPart(player.x, player.y, "#0ff", 30); } function rainFire(n) { for(let i=0;i<n;i++) spawn(player.x+(Math.random()-0.5)1500, player.y-900, 1.57, Math.random()15+25, "#f40", 1e6); } function circleShot(n,v,c,d) { for(let i=0;i<n;i++) spawn(player.x, player.y, i2Math.PI/n, v, c, d); } function burst(n,v,c,d) { for(let i=0;i<n;i++) spawn(player.x, player.y, getA()+(Math.random()-0.6), v, c, d); } function bigShot(n) { for(let i=0;i<n;i++) setTimeout(()=>spawn(player.x,player.y,getA()+(Math.random()-0.1)0.2,70,"#ff0",1.5e7),i40); } function voidStorm() { let t=setInterval(()=>aoe(boss.x+(Math.random()-0.5)800,boss.y+(Math.random()-0.5)800,300,"#306",3e7),80); setTimeout(()=>clearInterval(t),3000); } function iceAge() { timeStop=400; msg("THỜI GIAN NGƯNG ĐỌNG", "#0ff"); aoe(boss.x, boss.y, 600, "#0ff", 2e8); } function divineBless() { player.hp=5000; player.invul=180; msg("THÁNH QUANG HỘ THỂ", "#ff0"); }

let mouseX=0, mouseY=0; window.onmousemove = e => { mouseX = e.clientX; mouseY = e.clientY; }; window.onkeydown = e => { keys[e.code] = 1; let w = WEAPONS[player.wp]; if(e.code==="KeyZ" && player.cd.Z<=0) { w.Z(); player.cd.Z=CDTIME.Z; } if(e.code==="KeyX" && player.cd.X<=0) { w.X(); player.cd.X=CDTIME.X; } if(e.code==="KeyC" && player.cd.C<=0) { w.C(); player.cd.C=CD_TIME.C; } }; window.onkeyup = e => keys[e.code] = 0;

function update() { camX += (player.x - canvas.width/2 - camX) * 0.1; camY += (player.y - canvas.height/2 - camY) * 0.1; if(shake > 0) { camX += (Math.random()-0.5)shake; camY += (Math.random()-0.5)shake; shake *= 0.9; }

let speed = 14;
if(keys.KeyW) player.y -= speed; if(keys.KeyS) player.y += speed;
if(keys.KeyA) player.x -= speed; if(keys.KeyD) player.x += speed;
player.hp = Math.min(5000, player.hp + 10);
if(player.invul > 0) player.invul--;

// LOOT VŨ KHÍ
items.forEach((it, i) => {
    if(Math.hypot(it.x - player.x, it.y - player.y) < 120) {
        player.wp = it.wp; items.splice(i, 1);
        msg("NHẬN: " + WEAPONS[it.wp].name, WEAPONS[it.wp].color);
    }
});

// TỰ ĐỘNG BẮN
if(Date.now() % 60 < 25) spawn(player.x, player.y, getA(), 45, WEAPONS[player.wp].color, WEAPONS[player.wp].dmg);

// BOSS AI
if(timeStop <= 0) {
    boss.ai++;
    let a = Math.atan2(player.y - boss.y, player.x - boss.x);
    let isEnraged = boss.hp / boss.max < 0.4;

    let bSpd = isEnraged ? 1.5 : 0.8; 
    boss.vx += Math.cos(a) * bSpd;
    boss.vy += Math.sin(a) * bSpd;
    boss.x += boss.vx; boss.y += boss.vy;
    boss.vx *= 0.95; boss.vy *= 0.95;

    if(isEnraged && !boss.enrage) { boss.enrage = true; msg("BOSS CUỒNG NỘ!", "#f00"); boss.size = 180; }

    if(boss.ai % (isEnraged ? 30 : 50) === 0) {
        bBullets.push({x: boss.x, y: boss.y, vx: Math.cos(a)*20, vy: Math.sin(a)*20, s: 70, dmg: 2000});
    }
    if(boss.ai % 150 === 0) {
        for(let i=0; i&lt;24; i++) {
            let ang = (i/24)*Math.PI*2;
            bBullets.push({x: boss.x, y: boss.y, vx: Math.cos(ang)*12, vy: Math.sin(ang)*12, s: 45, dmg: 1200});
        }
    }
    if(Math.random() < 0.008) items.push({x: player.x+(Math.random()-0.5)*2000, y: player.y+(Math.random()-0.5)*2000, wp: Math.floor(Math.random()*WEAPONS.length), s:0});
} else timeStop--;

// XỬ LÝ VA CHẠM
bullets.forEach((b,i) => {
    b.x += b.vx; b.y += b.vy;
    if(Math.hypot(b.x-boss.x, b.y-boss.y) < boss.size) {
        boss.hp -= b.d;
        if(!b.aoe) bullets.splice(i,1);
    }
    if(b.life && --b.life <= 0) bullets.splice(i,1);
});

bBullets.forEach((b,i) => {
    b.x += b.vx; b.y += b.vy;
    if(player.invul <= 0 && Math.hypot(b.x-player.x, b.y-player.y) < 60) {
        player.hp -= b.dmg; bBullets.splice(i,1);
        shake = 10;
    }
    if(Math.hypot(b.x-player.x, b.y-player.y) > 3000) bBullets.splice(i,1);
});

particles.forEach((p,i) => { p.x+=p.vx; p.y+=p.vy; if(--p.l<=0) particles.splice(i,1); });
player.ghost.forEach((g,i) => { if(--g.l<=0) player.ghost.splice(i,1); });
items.forEach(it => it.s = Math.min(60, it.s+3));

// CẬP NHẬT COOLDOWN UI
for(let k in player.cd) {
    if(player.cd[k]>0) player.cd[k]--;
    let percent = (1 - player.cd[k] / CD_TIME[k]) * 100;
    document.getElementById(`bar-${k}`).style.width = percent + "%";
    document.getElementById(`txt-${k}`).innerText = player.cd[k] <= 0 ? "READY" : Math.ceil(player.cd[k]/60) + "s";
}

document.getElementById("p-hp").innerText = Math.max(0, Math.floor(player.hp));
document.getElementById("hp-fill").style.width = Math.max(0, (boss.hp/boss.max*100)) + "%";
document.getElementById("wp-name").innerText = WEAPONS[player.wp].name;
document.getElementById("wp-name").style.color = WEAPONS[player.wp].color;

}

function draw() { ctx.fillStyle = "#020202"; ctx.fillRect(0,0,canvas.width,canvas.height); ctx.save(); ctx.translate(-camX, -camY);

// GRID
ctx.strokeStyle = "#111"; ctx.lineWidth = 1;
let gx = Math.floor(camX/300)*300, gy = Math.floor(camY/300)*300;
for(let x=gx; x&lt;gx+canvas.width+300; x+=300) { ctx.beginPath(); ctx.moveTo(x, gy-300); ctx.lineTo(x, gy+canvas.height+300); ctx.stroke(); }
for(let y=gy; y&lt;gy+canvas.height+300; y+=300) { ctx.beginPath(); ctx.moveTo(gx-300, y); ctx.lineTo(gx+canvas.width+300, y); ctx.stroke(); }

// BOSS
ctx.shadowBlur = boss.enrage ? 50 : 20; ctx.shadowColor = "#f00";
ctx.fillStyle = "#000"; ctx.fillRect(boss.x-boss.size, boss.y-boss.size, boss.size*2, boss.size*2);
ctx.strokeStyle = boss.enrage ? "#ff0000" : "#ff4444"; ctx.lineWidth = 5; ctx.strokeRect(boss.x-boss.size, boss.y-boss.size, boss.size*2, boss.size*2);

// VẬT PHẨM
items.forEach(it => {
    ctx.shadowBlur=30; ctx.shadowColor=WEAPONS[it.wp].color; ctx.fillStyle=WEAPONS[it.wp].color;
    ctx.fillRect(it.x-it.s/2, it.y-it.s/2, it.s, it.s);
});

// PLAYER & EFFECT
player.ghost.forEach(g => { ctx.globalAlpha=g.l/20; ctx.fillStyle=WEAPONS[player.wp].color; ctx.beginPath(); ctx.arc(g.x,g.y,40,0,7); ctx.fill(); });
ctx.globalAlpha=1; ctx.shadowBlur=30; ctx.shadowColor=WEAPONS[player.wp].color;
ctx.fillStyle = player.invul > 0 ? "#fff" : WEAPONS[player.wp].color;
ctx.beginPath(); ctx.arc(player.x, player.y, 45, 0, 7); ctx.fill();

// BULLETS
ctx.shadowBlur=0;
bullets.forEach(b => { 
    ctx.fillStyle=b.c; 
    if(b.aoe) { ctx.globalAlpha = b.life/50; ctx.beginPath(); ctx.arc(b.x, b.y, b.s, 0, 7); ctx.fill(); ctx.globalAlpha=1; }
    else { ctx.beginPath(); ctx.arc(b.x, b.y, 20, 0, 7); ctx.fill(); }
});

bBullets.forEach(b => { 
    ctx.fillStyle="#fff"; ctx.shadowBlur=20; ctx.shadowColor="#f00"; 
    ctx.beginPath(); ctx.arc(b.x, b.y, b.s/2, 0, 7); ctx.fill(); 
});

particles.forEach(p => { ctx.globalAlpha=p.l/30; ctx.fillStyle=p.c; ctx.fillRect(p.x,p.y,p.s,p.s); });

ctx.restore();
update();

if(player.hp > 0 && boss.hp > 0) requestAnimationFrame(draw);
else {
    ctx.fillStyle = "rgba(0,0,0,0.7)"; ctx.fillRect(0,0,canvas.width,canvas.height);
    ctx.fillStyle = boss.hp<=0 ? "#ffd700" : "#ff0000"; ctx.font = "bold 100px Oswald"; ctx.textAlign = "center";
    ctx.fillText(boss.hp<=0 ? "VICTORY" : "DEFEATED", canvas.width/2, canvas.height/2);
    ctx.font = "30px Oswald"; ctx.fillStyle = "#fff";
    ctx.fillText("F5 ĐỂ CHƠI LẠI", canvas.width/2, canvas.height/2 + 80);
}

}

draw(); window.onresize = () => { canvas.width=innerWidth; canvas.height=innerHeight; }; </script> </body> </html>

Huy hiệu

Người dùng này không có huy hiệu nào.

«    »
CN
T2
T3
T4
T5
T6
T7
Ít
Nhiều

dựa trên nền tảng DMOJ | theo dõi VNOI trên Github và Facebook