Dear superhero,
I like game a lot, and i some how i believe i have plenty of idea in my mind and i wish i can create my very own first game, even very basic game will do.
I have no programming background at all, which mean, i know nothing about those code and language. But i willing to learn..
So, here come the question, where so i start? What should i learn first? I have no fund to college or Uni to study, all i can do is learn from web.
Please advice.
From
Weak Civilian from Earth.
this would be a very helpfull post here, check up
those lines
<canvas id='canvas' width='640' height='480'></canvas>
<script>
var x_pos = 320;
var y_pos = 200;
var width = 640;
var height = 480;
var game_won = false;
var canvas = document.getElementById("canvas").getContext("2d");
function DrawThings()
{
canvas.fillStyle="#004f00";
canvas.fillRect(0,0,width,height);
canvas.fillStyle="#ffffff";
canvas.fillRect(x_pos,y_pos,10,10);
canvas.font="22px arial";
canvas.fillStyle="#ff0000";
canvas.fillText(" EScape - Grrreat javascript game by fir ",20,20);
if(game_won)
{
canvas.fillStyle="#ffaa00";
canvas.fillText(" You escaped! :) Congratulations Game Over ",20,70);
}
}
function RunGame()
{
if(x_pos<0 || x_pos>width || y_pos<0 || y_pos>height) game_won = true;
DrawThings();
}
document.onkeydown = function()
{
switch (window.event.keyCode)
{
case 37: x_pos-=10; break;
case 38: y_pos-=10; break;
case 39: x_pos+=10; break;
case 40: y_pos+=10; break;
}
};
setInterval(function(){ RunGame();} , 100);
</script>
insert it into text file and rename it as a something.html then
you could run it in browser, This is quite powerfull and easy
environment to make some games (i wrote it in about half an
hour - it may be somewhat wrong, cause i never ever in my life was doin something html/javascript related, (i am c man), but it is very quick and fine way to start IMO) It is honey easy way to start running something.