Getting to know the Canvas

Published April 02, 2014
Advertisement
I am familiarizing myself with JS and HTML5, Canvas first ... not WebGL yet.

The first thing I am trying to do is programming what I had in mind when I heard that there is a combination between Tetris and 2048.
Not sure if the game mechanics will make a lick of sense, but I want to know what it feels like.

Working Title: NPAA (Not Proc At All)

I have not managed to keep the code clean, so I will have to refactor soon.
I also need to look at articles about object oriented programming in JS.
What I have so far are procedures, procedures, global constants and variables and ... procedures ... and already the if/else statements annoy me.

So far I can cycle through the different block types and their rotations (with the arrow keys).
The delayed response to the user action is a feature, not a bug btw. tongue.png
In the actual gameplay the response will be immediate.

The next step will either be writing some ugly gameplay logic ... or researching and refactoring.

npaa_screenshot001.png
Previous Entry Game Jam Focus
1 likes 6 comments

Comments

tnovelli

oh yeah, JS OO is funky. Here's what I settled on: http://tnovelli.net/ref/js.html#oop

April 03, 2014 11:23 AM
Gaiiden

is that page that's linked to supposed to do something?

April 05, 2014 01:09 AM
DareDeveloper

is that page that's linked to supposed to do something?

As soon as you click on the canvas the main program is running ... then the mentioned features should work:

... cycle through the different block types and their rotations (with the arrow keys) ...

April 06, 2014 06:06 PM
Gaiiden

oh, arrows keys. I missed that

April 06, 2014 09:42 PM
DareDeveloper

oh yeah, JS OO is funky. Here's what I settled on: http://tnovelli.net/ref/js.html#oop

I actually think that is good stuff ... finally I can create two blocks :-)

Probably hard to figure out, though ...

Moving on to gameplay ... and maybe some more refactoring.

April 07, 2014 09:43 PM
DareDeveloper

oh, arrows keys. I missed that

No bug then? Phew. Thanks for checking it out! :-)

April 07, 2014 09:47 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement