Jump to content

Game in Autoit?


Guest Beefteck
 Share

Recommended Posts

Guest Beefteck

Hey, i was just finishing up my program and then I thought, I wonder if games can be made in AutoIt. I knew that it could be done but I do not know how. Is there a begginers tutorial on how to make games useing auto. Also for my program in my next version I was hoping to have a picture move across the screen. Is there a code to do that? I can not seem to find anything on that other than that other post with the movable picture. Thanks for all the help members! :D

Link to comment
Share on other sites

Guest Beefteck

A basic simple game maybe, I am not quite sure wut kind of things with games/animation that you can do with AutoIt so I would love to learn it :D

Link to comment
Share on other sites

what do you see under "GAME" ?? since poker and other card games (called "static games") are easy to make with autoit.

if u want other games, like platform games (read: mario) Then u will need to write a nice piece of code for that first XD wich will take some time, but i think its possible. But autoit might be to slow (yes its SLOW)

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

Guest Beefteck

cool, thanks for that Inventor Game... this is what I ment as in a game... I want to try to make a 2d RPG Game through a GUI Interface (RPG or a retro looking game) is there any tutorials on that kind of stuff... even if it is not through the AutoIt site.

EDIT 1: :D Ok here is a very very early example. I have a problem, What I want to do is (i have made the man) When i move left I want it to look like he is running left, right = look like moving right, jump = looks like jump, duck = looks like he is ducking. I have tried to make them all but because they are all on the "field" at once When i move up the one to move up will move, when i move down the one that is ment to go down will move. I NEED ONE MAN AT A TIME ON THE FIELD AND WHEN I MOVE A NEW DIRECTION I NEED THE OLD MAN TO CHANGE INTO THE NEW MAN. Here is an example script i whiped up for you to work with. The man rite now is a basic thing in everyone pc so this way no one does not have it. Please help out with this. adding this would make me another step closer to making a game (lol) thankyou members! :wacko:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.1.1.0
 Author:         Beefteck

 Script Function:
    This is a basic game structure. If ever used credit for the snipplets used must be credited to Beefteck.

#ce ----------------------------------------------------------------------------


#include <GUIConstants.au3>

Dim $cX = 0
Dim $cY = 0

$image = "img1.jpg"

HotKeySet("{UP}", "Up")
HotKeySet("{Down}", "Down")
HotKeySet("{Right}", "Right")
HotKeySet("{Left}", "Left")
HotKeySet("{SPACE}", "Space")


;=====================================================

GUICreate("Beefteck's Temp Game", 900, 700, 100, 30,$WS_POPUP, $WS_MAXIMIZEBOX)

GUISetBkColor(0x000000)


;=====================================================

$pic1 = GUICtrlCreateIcon ("shell32.dll",10, 0,0)

;=====================================================

GUISetState()

While 1
    
    $Msg = GUIGetMsg()
    
If $Msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

;=====================================================

Func Up();Move Up
    $cY = $cY - 5
    GUICtrlSetPos($pic1, $cX, $cY)
EndFunc 

Func Down();Move Down
    $cY = $cY + 5
    GUICtrlSetPos($pic1, $cX, $cY)
    GUICtrlSetResizing($pic1, $GUI_DOCKSIZE)
EndFunc 

Func Right();Move Right
    $cX = $cX + 5
    GUICtrlSetPos($pic1, $cX, $cY)
EndFunc 

Func Left();Move Left
    $cX = $cX - 5
    GUICtrlSetPos($pic1, $cX, $cY)
EndFunc

Func Space();Jump Up
    $cY = $cY - 20
    GUICtrlSetPos($pic1, $cX, $cY)
    Sleep(0100)
    $cY = $cY + 20
    GUICtrlSetPos($pic1, $cX, $cY)
    GUICtrlSetResizing($pic1, $GUI_DOCKSIZE)


;=====================================================

EndFunc
Edited by Beefteck
Link to comment
Share on other sites

BTW, full-blown 3D graphics are painfully slow in AutoIt... you get what - 5 minutes per frame?

Then again, mine always errors out before it can complete 1 frame...

#)

Link to comment
Share on other sites

BTW, full-blown 3D graphics are painfully slow in AutoIt... you get what - 5 minutes per frame?

Then again, mine always errors out before it can complete 1 frame...

#)

Unless you just use a 3d image and GuiCtrlCreateImage it into the Game
Link to comment
Share on other sites

idk i was bored and was reading some topics and i saw your uh quote there paulie , ummmm i think i said that hahahahah (not sure though xD)

o and just to stay on topic there was a Really nice tetris game in the scripts and scraps check it out

Edited by thatsgreat2345
Link to comment
Share on other sites

Guest Beefteck

well i tried it now with two games... (see tankwars and spacwar in my signature)

yes it is possible, but you must be good, to get it fast XD

ssooo, is there a scrpit because really all that i need it to do is change from one .gif to another when a diffrent direction is pressed...
Link to comment
Share on other sites

well, i'm in the gamemaking stuff, so here are some ideas.

preload all the images u wanna use for the character (sprites)

then make a var called spite_index and a timed function that checks if the var changes, if it does take the new value in sprite_index and use it as sprite for the char.

so u can link sprLeft to c:\lookingleft.bmp

or sprWalkLeft[1] to c:\walkleft1.bmp (every step gets into the array, so u can make a loop to get trough it.)

if i have some spare time next week, i'll help u a little with ur project.

add me on msn.

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

HI,

there are several like this games already written in Autoit. Have a look at CtachtheClown. Search for it.

So long,

Mega

P.S.: In the German Forum there was already a Game-Contest.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

**Code Snipet Credits go to beefteck**

@beefteck:

I think it would be better to use these functions, i edited them so it will detect your location in comparison to the size of the gui, so when your character is too close to the edge he wont move anymore, so the character can no longer leave the screen.

this may be a bit confusing so ill upload my script so far.

Game.zip ; extract to any folder, and run the Game.au3 script, the character should be able to move (not the walking graphics yet) but when reaching the edge of the screen, he should stop...

i hope this helps, if not...whatever. i tryed...

Link to comment
Share on other sites

Guest Beefteck

**Code Snipet Credits go to beefteck**

@beefteck:

I think it would be better to use these functions, i edited them so it will detect your location in comparison to the size of the gui, so when your character is too close to the edge he wont move anymore, so the character can no longer leave the screen.

this may be a bit confusing so ill upload my script so far.

Game.zip ; extract to any folder, and run the Game.au3 script, the character should be able to move (not the walking graphics yet) but when reaching the edge of the screen, he should stop...

i hope this helps, if not...whatever. i tryed...

wow thanks this is what i was going to need help for next :whistle: anyway what folder does it need to be in because it will just show a blank GUI box... i would like to try this out to see if this is somthing that we could try in our game... Edited by Beefteck
Link to comment
Share on other sites

it should be able to be in any directory, you just have to make sure that the folders "Include", and "Sprites" are inside it also.

i havent added walking frames yet, the character just moves while facing the direction he is moving, ill work on it later.

(it should be pretty easy, if anyone has heard of it, its called RPGMakerXP and uses a language called Ruby (RGSS) if you look dl the trial of RMXP you can get all the scripts and see how they make the walking frames for each direction, i think thats how im going to figure it all out.)

Edit:

sorry my bad, when i uploaded the first file i didnt have the directions set, try this, if it still doesnt work, ill compile the whole thing and try that...

here is the correct files.

Game.zip

Edited by Naufuge
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...