"Code note" Multi-threaded game development--Voodoo: The first step--Start the Game Interface implementation (a)

Source: Internet
Author: User
Tags in domain

  1. Voodoo is the most memorable game in junior high school life. At that time, although there are internet cafes but not how to play.
  2. As a step-by-step 4980 learning Machine (after the 4988,5980,5988 Learning Machine), the year has a series of classic games, now really feel that the game team is really good, the quality of the single, the game is only hundreds of KB, but playable, The plot and visualization have reached a height of a learning machine with only 4MB of memory.
  3. At that time, step by step high this kind of machine learning Classic game has: Three Kingdoms BR, Knight line (actually want to do this game, but it was a pity, did not play too much), voodoo (playing customs-the ultimate spoiler: Inorganic road length is the biggest villain)
  4. The first design of the Lord's screen of Voldemort.
  5. Of course, the inside of the picture itself p out of a painting up.
  6. Then is the current progress of the file project directory
  7. In the domain package, there is the main function and the master function.
  8. Domain.java
    1. 1  Package Com.edp.domain; 2 3  Public class Domain {4      Public Static void Main (string[] args) {5         New ktdlgame (). Initframe (); 6     }7 }

  9. Very simply, there is only one line of code in Domain.java, just to start the window initialization and opening.
  10. Ktdlgame.java
    1. 1  PackageCom.edp.domain;2 3 ImportJava.awt.Graphics;4 5 ImportJavax.swing.JFrame;6 7 ImportCom.edp.huabi.PaintHead;8 ImportCom.edp.interf.ChangLiangQingDan;9 Ten@SuppressWarnings ("Serial") One  Public classKtdlgameextendsJFrameImplementschangliangqingdan{ A      PublicGraphics G; -      PublicPainthead Painthead; -      the      Public voidInitframe () { -          This. SetSize (600,600); -          This. setdefaultcloseoperation (3); -         //setting a form cannot change size +          This. setresizable (false); -          This. Setlocationrelativeto (NULL); +         //Add Panel APainthead ph =NewPainthead ( This); at          This. Add (ph); -          This. setvisible (true); -  -     } -}

  11. The keynote function is also simple, define a method Initframe, and initialize the form with the tools (methods) inside the JFrame package. Then use the previously overloaded Painthead.java for specific page design operations.

"Code note" Multi-threaded game development--Voodoo: The first step--Start the Game Interface implementation (a)

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.