Java production is the hardest practiced hand speed game, Faker can't stick to a minute

Source: Internet
Author: User

650) this.width=650; "src=" Http://p1.pstatp.com/large/22d70000458a43cb1abd "alt=" Java making the most difficult practiced hand speed game, Faker will not stick to a minute style= "border:0px;margin:10px auto;"/>

Want to practiced hand speed, come on, hurt each other.

Java make the hardest practiced hand speed game, visual Faker can not hold a minute

Production ideas: Java implementation only. Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java, Java

The letter model should be the protagonist of the whole game, because the whole game process involves its movement, such as falling, disappearing, producing, etc., the first should consider the position of the letter immediately, in the game constantly falling, calculate the height of falling, falling speed, etc.

The interface of the game is drawn by the JFrame class encapsulated in Java, the drawing method in the JFrame can be directly rewritten to draw the graphics image, but also need to pass in the Graphics object parameters, which is equivalent to give it a brush, as required to draw, This is the principle of drawing.

To implement the typing algorithm needs to implement the JFrame keyboard listener event, which is very simple operation, and then is the keyboard of the received keyboard events recorded down, it once and the letter in the collection of each letter is compared, if the same is eliminated the letter, and the execution of extra points, new random letter operation.

(If you need more Java Enterprise job hunting or fun play source code and ideas, you can come to my Java group 515675832, every day will be carefully selected a new program to play out the detailed explanation, share! Including answering questions! )

650) this.width=650; "src=" http://p3.pstatp.com/large/22d2000051e042a531b2 "alt=" Java making the most difficult practiced hand speed game, Faker will not stick to a minute style= "border:0px;margin:10px auto;"/>

Game structure

Algorithm idea:

The game's overall algorithm is mainly a number of algorithms to draw images, and the programming language in the packaging of the class is very much related to the Java graphical interface of the frame class is the early production of graphical user interface of a package class, which provides a lot of human-computer interaction components, such as buttons, tags, drop-down menu, etc., However, these components are not used primarily in this game. In this game we mainly draw some custom graphical images, first of all we want to rewrite the frame class inside the update () method, which is to update the frame interface of the image will use the class, on which the first drawing a canvas (in fact, the creation of an empty image), Then you get the canvas's brush (the object that the graphics is built in), draw the canvas, and then draw the canvas in the update () method, which is designed to "double-buffer" to prevent the image from flashing more severely because of excessive drawing of the image, At the same time, it is necessary to set the interval when drawing, otherwise it will cause the movement of the image to look unnatural, or the speed of the drawing is not conducive to the normal game.

Part code: 650) this.width=650; "src=" Http://p3.pstatp.com/large/22d700004a99113849e7 "alt=" Java making the most difficult practiced hand speed game, Faker can not hold a minute "Style=" border:0px;margin:10px auto; "/>

The document version of the code will be nameless devour, so can only send a picture version, in fact, the full version is not long

Need documentation code practiced hand friends come to my Java group 515675832, every day will be carefully selected a new program to play out the detailed explanation, share! Including Questions and answers!

This typing game, is a can exercise the player typing speed of casual games, the interface layout is simple, suitable for the majority of users of the age level leisure, relaxation. Also suitable for some teenagers have their own reaction consciousness and hand speed Oh, you can modify the code so that it only drops QWERDF and so on the letter Oh, like to focus on me



This article is from the "12911315" blog, please be sure to keep this source http://12921315.blog.51cto.com/12911315/1930483

Java production is the hardest practiced hand speed game, Faker can't stick to a minute

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.