找回密码
 加入
搜索
查看: 4832|回复: 17

[图形处理] 简单的游戏(已解决)

[复制链接]
发表于 2017-3-28 09:39:21 | 显示全部楼层 |阅读模式
本帖最后由 lxwlxwayy 于 2017-4-7 14:24 编辑

想写个游戏思路是这样的,谁能给些代码


Shift控制飞船向下
空格向上

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2017-3-28 09:50:17 | 显示全部楼层
飞船自动向前飞行速度越来越快,碰到物体就结束游戏
 楼主| 发表于 2017-3-28 09:53:17 | 显示全部楼层
而且要带背景音乐
 楼主| 发表于 2017-3-28 10:29:05 | 显示全部楼层
#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
发表于 2017-3-28 11:05:56 | 显示全部楼层
你这是要自己写还是要别人给你写啊?
 楼主| 发表于 2017-3-28 12:11:26 | 显示全部楼层
大家都来写,有代码的上代码,有思路的上思路,有成品的上成品
 楼主| 发表于 2017-3-28 12:11:53 | 显示全部楼层
最重要的是算法,有算法的上算法
 楼主| 发表于 2017-3-28 12:41:45 | 显示全部楼层
本帖最后由 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_[0], "int", 1)

_ArrayDisplay($BASS_ret_,"3")
;DllCall($_ghBassDll, "int", "BASS_ChannelPlay", "DWORD", $BASS_ret_[0], "int", 1)
;Sleep(4000)
Next
DllClose($_ghBassDll)

    WEnd
EndFunc   ;==>Example
声音连续播放怎么弄
加载背景音乐

加入飞船

加入检碰撞

加入方条

加入变色

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2017-3-30 00:07:00 | 显示全部楼层
你说那个游戏这是什么语言写的
发表于 2017-3-30 15:31:12 | 显示全部楼层
it is cool
发表于 2017-3-30 15:31:32 | 显示全部楼层
确实很不错  值得学习!!!!
发表于 2017-3-30 22:38:03 | 显示全部楼层
学习学习
发表于 2017-3-31 08:54:46 | 显示全部楼层
可以,学习学习
发表于 2017-3-31 09:37:23 | 显示全部楼层
Au3写的么?
 楼主| 发表于 2017-3-31 12:16:02 | 显示全部楼层
小游戏单线程
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-28 18:53 , Processed in 0.094475 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表