CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - puzzle of number
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - puzzle of number - List
[
Software Engineering
]
vbkesebaogao
DL : 0
一种拼图的游戏,可以为大量纠结vb的人解决难题-One kind of puzzle game, you can tangle vb for a large number of people to solve problems
Date
: 2025-12-20
Size
: 9kb
User
:
宫振华
[
Software Engineering
]
99
DL : 0
1)编程思路:本练习因为要制作拼图游戏,所以首先要实现图片的导入。这是通过getImage()函数来实现的,该函数有两个参数,第一个参数指明图片的路径,第二个参数指明图片的名称。然后,因为要实现图片摆放的随意性,所以要通过initgame()函数来实现。Initgame()函数是自写函数,在函数体内,通过调用Math.random()函数产生随机数,用来达到图片位置摆放的随意性和随机性。最后,因为要实现人机交互.,所以首先要通过一系列函数来实现对鼠标事件的监听和响应,这是通过函数addMouseListener(this) 和addMouseMotionListener(this)来完成的。这样程序会区分用户对鼠标不同的操作,正确执行相应的功能。-1) programming ideas: To make this exercise because the puzzle, so we must first realize the import of the picture. This is done by getImage () function to achieve, the function has two parameters, the first parameter indicates the path of the picture, and the second parameter specifies the name of the picture. Then, because the picture placed to achieve randomness, so to be achieved through initgame () function. Initgame () function is a self-written functions in vivo function by calling Math.random () function generates a random number used to reach the position of placing pictures arbitrariness and randomness. Finally, due to the realization of human-computer interaction., So the first thing to be achieved through a series of functions for monitoring and responding to mouse events, this is done by the function addMouseListener (this) and addMouseMotionListener (this) to complete. This program will distinguish the different users of the mouse operation, the correct implementation of
Date
: 2025-12-20
Size
: 797kb
User
:
张飞
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.