Jump to content
Sign in to follow this  
  • entries
    17
  • comments
    30
  • views
    17904

Getting to know the Canvas

Sign in to follow this  
DareDeveloper

817 views

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
Sign in to follow this  


6 Comments


Recommended Comments

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) ...

Share this comment


Link to comment

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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!