简单的游戏(已解决)
本帖最后由 lxwlxwayy 于 2017-4-7 14:24 编辑想写个游戏思路是这样的,谁能给些代码
Shift控制飞船向下
空格向上
飞船自动向前飞行速度越来越快,碰到物体就结束游戏 而且要带背景音乐
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $msg
GUICreate("My Game"); will create a dialog box that when displayed is centered
GUISetBkColor(0x000000); will change background color
GUISetState() ; will display an empty dialog box
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example
你这是要自己写还是要别人给你写啊? 大家都来写,有代码的上代码,有思路的上思路,有成品的上成品 最重要的是算法,有算法的上算法 本帖最后由 lxwlxwayy 于 2017-4-3 08:04 编辑
#include <GUIConstantsEx.au3>
#include <Array.au3>
Global $_ghBassDll
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $msg
GUICreate("My Game"); will create a dialog box that when displayed is centered
GUISetBkColor(0x000000); will change background color
GUISetState() ; will display an empty dialog box
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
$_ghBassDll = DllOpen("tty.dll")
Local $flag = 1024
Local $ret = DllCall($_ghBassDll, "int", "BASS_Init", "int", -1, "dword", 44100, "dword", 1024, "hwnd", 0, "hwnd", "")
Local $file = @ScriptDir&"\shot_rapid.wav"
Local $tpFile = "ptr"
If IsString($file) Then $tpFile = "wstr"
Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_StreamCreateFile", "int", False, $tpFile, $file, "uint64", 0, "uint64", 0, "DWORD", BitOR(0x20000, 0x80000000))
For $ii = 1 To 5
;Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_StreamCreateFile", "int", False, $tpFile, $file, "uint64", 0, "uint64", 0, "DWORD", BitOR(0x20000, 0x80000000))
DllCall($_ghBassDll, "int", "BASS_ChannelPlay", "DWORD", $BASS_ret_, "int", 1)
_ArrayDisplay($BASS_ret_,"3")
;DllCall($_ghBassDll, "int", "BASS_ChannelPlay", "DWORD", $BASS_ret_, "int", 1)
;Sleep(4000)
Next
DllClose($_ghBassDll)
WEnd
EndFunc ;==>Example
声音连续播放怎么弄
加载背景音乐
加入飞船
加入检碰撞
加入方条
加入变色
你说那个游戏这是什么语言写的 it is cool 确实很不错值得学习!!!! 学习学习{:face (396):} 可以,学习学习 Au3写的么? 小游戏单线程
页:
[1]
2