just asking
ozlosys
Creator of
Recent community posts
test mod:
what it does:
- adds a new level (page 3)
(It has a boss fight):
code:
//this runs every frame
if (where_at === "playing" && place_at === "post drawing" && vars.tag === "boss lvl 1") {
var angle = Math.atan2(py - vars.boss_y + 15, px - vars.boss_x + 15);
vars.boss_x += Math.cos(angle) * 0.5;
vars.boss_y += Math.sin(angle) * 0.5;
ctx.fillStyle = "rgb(255, 0, 200)";
ctx.fillRect(vars.boss_x, vars.boss_y, 30, 30);
if (directions.up) {
vars.boss_y += 3;
}
if (directions.down) {
vars.boss_y -= 3;
}
if (directions.left) {
vars.boss_x += 3;
}
if (directions.right) {
vars.boss_x -= 3;
}
vars.wait1 --;
if (vars.stage === 1) {
if (vars.wait1 <= 0) {
angle = rand(Math.PI * 2);
for(var u = 0; u < 6; u ++) {
bullets.push(new bullet(vars.boss_x + 15, vars.boss_y + 15, Math.cos(angle) * 5, Math.sin(angle) * 5));
angle += Math.PI / 3;
}
vars.wait1 = 100;
}
} else if (vars.stage === 2) {
if (vars.wait1 <= 0) {
vars.wait1 = 50;
angle = rand(Math.PI * 2);
for(var u = 0; u < 50; u ++) {
bullets.push(new bullet(vars.boss_x + 15, vars.boss_y + 15, Math.cos(angle) * 8, Math.sin(angle) * 8));
angle += Math.PI / 25;
}
}
} else if (vars.stage === 3) {
if (vars.wait1 <= 0) {
vars.wait1 = 50;
for(var u = 0; u < 5; u++) {
bullets.push(new bullet(vars.boss_x + 15, vars.boss_y + 15, Math.cos(vars.attack_angle) * 4, Math.sin(vars.attack_angle) * 4));
vars.attack_angle += Math.PI / 25;
}
vars.attack_angle = rand(Math.PI * 2);
}
}
vars.stage_wait --;
if (vars.stage_wait <= 0) {
vars.stage_wait = 800;
vars.stage = ran(3) + 1;
vars.wait1 = 0;
}
}
if (where_at === "official levels" && place_at === "levels post drawing" && page === 2) {
console.log("you should see the thing lol");
ctx.fillStyle = "rgb(200, 200, 200)";
ctx.fillRect(100, 100, 100, 100);
ctx.strokeStyle = "rgb(0, 0, 0)";
ctx.lineWidth = 1;
if (mouse_inside(100, 100, 100, 100)) {
ctx.lineWidth = 3;
if (md) {
lava_blocks = [new l(-64,-98,52,1073,"lava"),new l(-36,944,924,52,"lava"),new l(891,181,59,815,"lava"),new l(874,938,41,72,"lava"),new l(-28,-103,914,57,"lava"),new l(872,-104,88,289,"lava"),new l(215,299,67,75,"lava"),new l(728,-18,113,64,"lava"),new l(763,-59,46,73,"lava"),new l(823,-2,78,31,"lava"),new l(31,-9,111,44,"lava"),new l(63,-54,41,54,"lava"),new l(-17,5,63,19,"lava"),new l(32,876,120,40,"lava"),new l(80,913,31,33,"lava"),new l(-17,882,61,23,"lava"),new l(750,876,105,37,"lava"),new l(785,901,30,47,"lava"),new l(853,884,37,18,"lava"),new l(463,305,60,76,"lava"),new l(463,515,64,65,"lava"),new l(208,497,68,78,"lava"),new l(501,106,208,53,"lava"),new l(93,114,221,41,"lava"),new l(64,763,187,42,"lava"),new l(504,756,287,42,"lava"),];
where_at = "playing";
vars.tag = "boss lvl 1";
}
}
ctx.strokeRect(100, 100, 100, 100);
ctx.fillStyle = "rgb(0, 0, 0)";
ctx.textAlign = "center";
ctx.font = "20px Georgia";
ctx.fillText("1st boss!", 150, 90);
}
//this only runs once
vars.tag = 0;
vars.boss_x = 350;
vars.boss_y = 0;
vars.wait1 = 100;
vars.stage_wait = 800;
vars.stage = 2;
vars.attack_angle = 0;
console.log("yay");
This is for people to post tips for making ASCII art, game design or just handy tips.
My tips:
\n to make a new line
console.log("text"); to output
console.clear(); to clear the console
console.table(array_name); to output an array of objects in an orderly fashion
use document.addEventListener() to listen for key presses and other events:
"mousedown"(detect when mouse is down), "mouseup"(opposite of mousedown), "keydown"(when a key is held down), "keyup" (the opposite of keyup)
you can use console.group to make an inventory, like so:
var inventory = ["cat", "dog", "dog"];
console.group("inventory");
for(var i = 0; i < inventory.length; i++) {
console.log(inventory[i]);
}
console.groupEnd();
make sure to put a console.groupEnd(); after it, or else anything you type will become part of the inventory group.
Okay. I have no experience with the engine, but I can make art and music for it. I may be able to learn some godot in the next few months, though.
We could communicate using google meet, hangouts, email... I'll be okay with using any communication platform.
Your game was very cool! mine aren't very good because I do not use a game engine. How much time did you have to make it?
I'd love to. I have a youtube channel where I make videos about my music and programming projects:https://www.youtube.com/channel/UCYCxo3ZNnWN1UxEGtoIzZEA
I could make the music and some sprites or I could program and you design (or something like that).