Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
A jam submission

Handheld Space VoyagerView game page

Handheld like game, made for CLD-jam.
Submitted by lgeoinc — 23 hours, 53 minutes before the deadline

Play (click it twice)

Handheld Space Voyager's itch.io page

Results

CriteriaRankScore*Raw Score
Winner#131.8331.833
Sound#131.5001.500
Graphics#141.8331.833
Gameplay#141.8331.833

Ranked from 6 ratings. Score is adjusted from raw score by the median number of ratings per game in the jam.

Source Code
//lil messy but :)))
<html>
<canvas id="gamecanvas" width="220" height="250"></canvas>
<script>
var canvas;
var ccontext;
var fps = 10;
var ST = new Audio();
ST.src = "soundtrack.mp3";
var autoplay = 0;

var onex;
var twox;
var threex;
var fourx;
var fivex;
var sixx;
var sevenx;
var eightx;

var oney = Rnd(20,37);
var twoy = Rnd(38,55);
var threey = Rnd(56,73);
var foury = Rnd(74,91);
var fivey = Rnd(92,109);
var sixy = Rnd(110,127);
var seveny = Rnd(128,144);
var eighty = -100;
var bulletspeed = 6;
var bulletdamage = 0.0125;
var playerXX = 50;
var playerYY = 90;


var health = 134;
var Butt1 = "#7f7f7f";
var Butt2 = "#7f7f7f";
var DH = 5;
var SC = 0;


window.addEventListener("keydown", checkKeyPress, false);
function checkKeyPress(key) {

//w
if (key.keyCode == "87" && DH <= 5) {
autoplay = 10;
if(playerYY > 25){
playerYY = playerYY - 10;
}
Butt1 = "#4c4c4c";
}
if (key.keyCode == "87" && DH >= 5) {
autoplay = 10;
revive();
Butt1 = "#4c4c4c";
}
//s
if (key.keyCode == "83" && DH < 5) {
autoplay = 10;
if(playerYY < 140){
playerYY = playerYY + 10;
}
Butt2 = "#4c4c4c";
}
if (key.keyCode == "83" && DH > 5) {
autoplay = 10;
revive();
Butt2 = "#4c4c4c";
}
//d "37"
//a "39"
}

function revive() {

playerXX = 50;
playerYY = 90;
health = 134;
DH = 1;
bullet1x();
bullet2x();
bullet3x();
bullet4x();
bullet5x();
bullet6x();
bullet7x();
bullet8x();
SC = 0;
bulletspeed = 4;
var bulletdamage = 0.025;
}

window.onload = function() {
canvas = document.getElementById("gamecanvas");
ccontext = canvas.getContext("2d");
crect(0,0,canvas.width,canvas.height,"#4c4c4c");
crect(3,3,canvas.width-6,canvas.height-6,"#e5e5e5");
bullet1x();
bullet2x();
bullet3x();
bullet4x();
bullet5x();
bullet6x();
bullet7x();
bullet8x();
setInterval(updatebullets,1000/300);
setInterval(renderAndplayer,1000/fps);
setInterval(rebutt,1000/3);
setInterval(scoreupdate,1500);
}
function scoreupdate(){
if(DH <5){
SC = SC + 1;
}
}
function playmusic(){
if (autoplay > 5){
ST.play();
}
}
function rebutt() {
Butt1 = "#7f7f7f";
Butt2 = "#7f7f7f";
}
function updatebullets() {
bulletdamage = bulletdamage + 0.005;

if(onex < 60){
if(oney > playerYY - 1 && oney < playerYY+10){
health = health - bulletdamage;
bullet1x()
bullet1y()
}
}
if(twox < 60){
if(twoy > playerYY - 1 && twoy < playerYY+10){
health = health - bulletdamage;
bullet2x()
bullet2y()
}
}
if(threex < 60){
if(threey > playerYY - 1 && threey < playerYY+10){
health = health - bulletdamage;
bullet3x()
bullet3y()
}
}
if(fourx < 60){
if(foury > playerYY - 1 && foury < playerYY+10){
health = health - bulletdamage;
bullet4x()
bullet4y()
}
}
if(fivex < 60){
if(fivey > playerYY - 1 && fivey < playerYY+10){
health = health - bulletdamage;
bullet5x()
bullet5y()
}
}
if(sixx < 60){
if(sixy > playerYY - 1 && sixx < playerYY+10){
health = health - bulletdamage;
bullet6x()
bullet6y()
}
}
if(sevenx < 60){
if(seveny > playerYY - 1 && seveny < playerYY+10){
health = health - bulletdamage;
bullet7x()
bullet7y()
}
}
if(eightx < 60){
if(eighty > playerYY - 1 && eighty < playerYY+10){
health = health - bulletdamage;
bullet8x()
bullet8y()
}
}
if(onex < 30){
bullet1x();
bullet1y();
}
if(twox < 30){
bullet2x();
bullet2y();
}
if(threex < 30){
bullet3x();
bullet3y();
}
if(fourx < 30){
bullet4x();
bullet4y();
}
if(fivex < 30){
bullet5x();
bullet5y();
}
if(sixx < 30){
bullet6x();
bullet6y();
}
if(sevenx < 30){
bullet7x();
bullet7y();
}
if(eightx < 30){
bullet8x();
bullet8y();
}
}

function renderAndplayer() {
if(DH > 5){
renderui();
render();
death();
}
if(DH < 5){
playmusic();
render();
bullet1();
bullet2();
bullet3();
bullet4();
bullet5();
bullet6();
bullet7();
bullet8();
player();
renderui();
}
if(DH == 5){
renderui();
render();
welcome();
}
}

function render() {
if(health < 0){
DH = 10;
}
//screen
crect(26,16,168,152,"#4c4c4c");
crect(30,20,160,144,"#cccccc");
if(DH == 5){
}else {
crect(80,6,60,12,"#4c4c4c");
score("score:",82,15,"#cccccc","10px arial");
score(SC,110,15,"#cccccc","10px arial");
}
//buttonbar
}

function score(text,x,y,color,xx){
ccontext.font = xx;
ccontext.fillStyle = color;
ccontext.fillText(text, x, y);
}

function bullet1() {
onex = onex - bulletspeed;
crect(onex,oney,5,5,"#999999");
//boom.play();
}

function bullet2() {
twox = twox - bulletspeed;
crect(twox,twoy,5,5,"#999999");
}

function bullet3() {
threex = threex - bulletspeed;
crect(threex,threey,5,5,"#999999");
}

function bullet4() {
fourx = fourx - bulletspeed;
crect(fourx,foury,5,5,"#999999");
}

function bullet5() {
fivex = fivex - bulletspeed;
crect(fivex,fivey,5,5,"#999999");
}

function bullet6() {
sixx = sixx - bulletspeed;
crect(sixx,sixy,5,5,"#999999");
}

function bullet7() {
sevenx = sevenx - bulletspeed;
crect(sevenx,seveny,5,5,"#999999");
}
function bullet8() {
eightx = eightx - bulletspeed;
crect(eightx,eighty,5,5,"#999999");
}

//create x cordinates
function bullet1x() {
onex = Rnd(225,250);
}
function bullet2x() {
twox = Rnd(225,250);
}
function bullet3x() {
threex = Rnd(250,275);
}
function bullet4x() {
fourx = Rnd(275,300);
}
function bullet5x() {
fivex = Rnd(300,325);
}
function bullet6x() {
sixx = Rnd(325,350);
}
function bullet7x() {
sevenx = Rnd(350,375);
}
function bullet8x() {
eightx = Rnd(375,400);
}

function bullet1y() {
oney = Rnd(20,37);
}
function bullet2y() {
twoy = Rnd(38,55);
}
function bullet3y() {
threey = Rnd(56,73);
}
function bullet4y() {
foury = Rnd(74,91);
}
function bullet5y() {
fivey = Rnd(92,109);
}
function bullet6y() {
sixy = Rnd(110,127);
}
function bullet7y() {
seveny = Rnd(128,144);
}
function bullet8y() {
eighty = Rnd(-100,-99);
}


function player() {
//building body
//I dont use any sprites! what's the fun in them?
//It's so satisfying to make up objects form rectangles :)
var playerX = playerXX;
var playerY = playerYY - 14;
//head
crect(playerXX,playerYY,9,9,"#4c4c4c");
//feet
crect(playerXX-6,playerYY+1,6,2,"#7f7f7f");
crect(playerXX-12,playerYY+3,12,3,"#666666");
crect(playerXX-6,playerYY+6,6,2,"#7f7f7f");
}

function death(){
crect(30,20,160,144,"#cccccc");
txt1("YOU ARE DEAD!",55,80,"#4c4c4c","15px arial");
txt("PRESS W OR S",75,100,"#4c4c4c","10px arial");
txt("TO CONTINUE PLAYING",55,110,"#4c4c4c",1.5);
score("score:",82,15,"#cccccc","10px arial");
score(SC,110,15,"#cccccc","10px arial");

}

function welcome(){
crect(30,20,160,144,"#cccccc");
txt1("Wellcome!",75,80,"#4c4c4c","15px arial");
txt("AVOID GREY THINGYS",55,100,"#4c4c4c","10px arial");
txt("WITH W AND S BUTTONS",47,110,"#4c4c4c",1.5);

}

//ui
function renderui(){
crect(30,155,160,10,"#b2b2b2");
crect(55,156.5,health,7,"#7f7f7f");
txt("HP:",35,163,"#7f7f7f",1.5);
//sides
crect(194,10,23,170,"#e5e5e5");
crect(3,3,23,170,"#e5e5e5");
crect(190,20,3,144,"#4c4c4c");
crect(0,0,3,170,"#4c4c4c");
crect(217,0,3,170,"#4c4c4c");
//controller
button(60,210,25);
txt("W",55,213,"#e5e5e5",10);
button2(160,210,25);
txt("S",157,213,"#e5e5e5",1.5);
}

//Engine
function crect(Xpos,Ypos,width,height,color) {
ccontext.fillStyle = color;
ccontext.fillRect(Xpos,Ypos,width,height);
}
function Rnd(min, max) {
return Math.floor(Math.random() * (max - min) ) + min;
}
function button(Xpos,Ypos,diameter,) {
ccontext.beginPath();
ccontext.arc(Xpos,Ypos,diameter,0,2*Math.PI);
ccontext.fillStyle = Butt1;
ccontext.fill();

}
function button2(Xpos,Ypos,diameter,) {
ccontext.beginPath();
ccontext.arc(Xpos,Ypos,diameter,0,2*Math.PI);
ccontext.fillStyle = Butt2;
ccontext.fill();

}
function txt1(text,x,y,color,size){
ccontext.font = size;
ccontext.fillStyle = color;
ccontext.fillText(text, x, y);
}
function txt(text,x,y,color,zz){
ccontext.font = zz;
ccontext.fillStyle = color;
ccontext.fillText(text, x, y);
}
</script>
</html>

Leave a comment

Log in with itch.io to leave a comment.

Comments

HostSubmitted

Funny idea, but as you yourself admit, there are some cheats involved, so it's not really a game by the rules. On one of the rare occasions it worked and I could play (I think it hsa to do with the different browser setups I use), I also noticed a very unfair collision detection.

So the game stands on the margins for this Jam, but cudos for the work you've put in and continue the good work! (I think you could work more with loops, too)

DeveloperSubmitted(+1)

Bro, you are right. When I saw this jam I had already filled my whole mind with that idea, in fact I wanted to make this game so even when knew nothing about this jam. I had lots of fun making it and I love how you like to comfort developers even if their games are not that good.