Fall And Blocks

Hello!

Just created my second game, it’s a 3billionth Tetris clone: ‘Fall And Blocks’. :slight_smile:

http://asphaltgalaxy.com/test2/images/fallandblocks_small.png

Applet is here:
http://asphaltgalaxy.com/test2/fallandblocks.html

Features:

  • Global score
  • 4 sizes of board
  • 3 next shape view modes

Few words about me:

I am new to Java, but not so new to programming (working mostly with Oracle databases/forms/reports). I am reading this forum for several months, and found it very useful. Just do little more searching and your problem is solved :slight_smile:

I got problems with graphics (mean artwork), since I cannot draw. Thanks to modern drawing programs and their tutorials, I can do some very basic art. :slight_smile:

Nice! I loved the effects and the smooth transitions, makes for an overall polished feel. Actually quite amazing for a graphics beginner! Keep up the great work :slight_smile:

The applet has earphones on it so it doesn’t listen to my keyevent.

hint: I clicked the applet.

Thank you! Glad you liked it!

Hmmm. What OS r u using? I noticed some problems on some (tested on 2 actually :slight_smile: ) Linux distros. On one of them I just refreshed webpage with applet and everything went ok (without additional click on applet).

So, where to start?

Class where listener is looks like:

public class Board extends JPanel implements ActionListener, Runnable {

And the listener itself in this class is:


        private class TAdapter extends KeyAdapter {
            
        public void keyPressed(KeyEvent e) {

            int key = e.getKeyCode();

            switch (gamestate) {
                case RUNNING: {
                    switch (key) {
                        case KeyEvent.VK_LEFT: {
                            shape.MoveDirection(blockboard, BlockShape.Direction.LEFT);
                            break;
                        }
                        ...

Where could be a problem?

Well your code seems fine especially other user could try it (although I usually extends Applet instead container). I use win7 with firefox 9. I have noscript installed but already whitelisted your site. If I have to find the culprit, will blame jre7 or my browser :slight_smile:

And what about other applets? Is it ok with them on your machine?

It looks good: the artwork is very colorful, and the animations are good-looking too. However, it stuttered a bit on my (admittedly not so recent) laptop. Perhaps it’s generating a bit of “garbage”? Dunno, but the stuttering seems to happen like every second.

Nice game! I had a little bit of problems wi/ the speed at which blocks drop when pressing down - I’d like it just a little bit faster.
Also, there might be a problem with the timing of this… Maybe it’s just me.

I beat the highscore by one point, by the way. :persecutioncomplex:

@OP
other applet work fine, all game on java4k, ludum dare and my own. I cleared my browser cache and it works. Weird that it has something to do :smiley:

@Mads
Ienvy for your free time :slight_smile:

Very well done! I’m impressed. This is inspirational for a beginner like me!

~Shazer2

Thanks all of you! Really appreciate every response! It’s so motivating. :slight_smile:

@Mads

Hmm… I also noticed hi score with max integer value and your name by side. :slight_smile: How did you do that, what were your steps? I mean is it so easy and natural to insert fake score? Sure, I did nothing to prevent that, but there wasn’t form like ‘input your name and desired high score’, anyway someone should at least know, what page to call. I read some threads here about this topic and all I understood, it is close to impossible to make 100% secure functionality. I really need your opinion.

@Grunnt

Tested on Celeron 1.4 single core old notebook with Win XP and there was less than 25% cpu usage and memory usage was like constant. So, how could I check whats wrong?

I guess I was mistaken because I just tried it again and it went pretty smooth. Perhaps something on the background was causing the stuttering. Normally you can check for garbage generation using a profiler such as Oracle’s VisualVM (http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/profiler.html).

Hi OP, you said that you took tutorial to draw the graphics. Mind to share any good one?

Since I used Inkscape for game board background, so sharing here links to some Inkscape tutorials:


http://2dgameartforprogrammers.blogspot.com/

And exactly that one I used when was creating background for Fall And Blocks: :slight_smile:
http://2dgameartforprogrammers.blogspot.com/2011/10/more-fun-with-gradients.html

Hope it helps!

Bookmarked! thanks for the links :slight_smile: I never use Inkscape, hope it’ll no hard to pratice them on Paint.NET.

Actually, it’s quite easy to combine InkScape and Paint.Net. For example, use InkScape to make a general outline, export it to a bitmap, and do the finishing touch in Paint.Net.

I downloaded the inkscape to make life easier :wink:

That’s cool! Now, waiting for results :slight_smile: