Jump to content

Choppy game....


Rad
 Share

Recommended Posts

My game space invasion, working on the movement system etc... If I posted alot of code it would mostly just be repeats, but this part is from a while infinite loop

If IsPressed("27") Then;UP/RIGHT
                                        If $shiptype <> 1 Then
                                            GUICtrlSetImage($shipbmp,$ship[1])
                                            $shiptype=1
                                        Endif
                                        $shipcoord[0]=$shipcoord[0]+6
                                        $shipcoord[1]=$shipcoord[1]-6
                                        GUICtrlSetPos($shipbmp,$shipcoord[0],$shipcoord[1])
            Else

Its +-6 because it ran so slow (Even without having any sleep()s... Is there any way to make my ship run faster? Its pretty choppy right now... sometimes you fly REALLY fast and its smooth, other times the ship goes tick...tick...tick... like a clock ><

Also, if I compile the script and put it here is it possible to decompile it with the option off in the compiler settings?

Link to comment
Share on other sites

  • Moderators

Hi Rad, looks like your having fun with this :lmao: . Unfortunately for me, your using arrays and variables that you haven't shown how they are defined to give you an absolute answer. Is it possible to post more code than what you currently have?

Edit:

Compiler question:

1. If you only put the exe here, then most will not download it.

2. If you want to compile something with the option to decompile, you can give it a password or leave the password field blank, then use the Exe2Aut.exe to decompile it.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ok attached the file if you want to look at it, had to compile it so that it attaches the files etc

I thought the variables were pretty straight forward but ill clerify:

If IsPressed("27") Then;Right arrow coming off an up arrow if/then/else
        If $shiptype <> 1 Then    ;Integer keeps track of which 'frame' is being used
                GUICtrlSetImage($shipbmp,$ship[1])    ;shipbmp is the picture, ship[1] is the file for 'frame 1'
                $shiptype=1   ;integer keeps track of the frame
        Endif
        $shipcoord[0]=$shipcoord[0]+6     ;X coordinate
        $shipcoord[1]=$shipcoord[1]-6     ;Y coordinate
        GUICtrlSetPos($shipbmp,$shipcoord[0],$shipcoord[1])   ;picture, coordinates
         Else

EDIT~Attached compiled version you can decompile with password Rad

SpaceInvasion.zip

Edited by Rad
Link to comment
Share on other sites

  • Moderators

Ok attached the file if you want to look at it, had to compile it so that it attaches the files etc

I thought the variables were pretty straight forward but ill clerify:

If IsPressed("27") Then;Right arrow coming off an up arrow if/then/else
        If $shiptype <> 1 Then    ;Integer keeps track of which 'frame' is being used
                GUICtrlSetImage($shipbmp,$ship[1])    ;shipbmp is the picture, ship[1] is the file for 'frame 1'
                $shiptype=1   ;integer keeps track of the frame
        Endif
        $shipcoord[0]=$shipcoord[0]+6     ;X coordinate
        $shipcoord[1]=$shipcoord[1]-6     ;Y coordinate
        GUICtrlSetPos($shipbmp,$shipcoord[0],$shipcoord[1])   ;picture, coordinates
         Else
Well, the variables are indeed 'straight forward' :lmao: . Unfortunately, they don't show how you are defining them.

For some useless/priceless knowledge for you. You can compile your script, then decompile to a 'Decompiled_Scriptname.au3', and all your includes would in fact be in the decompiled script then. I use this sometimes in a few of my scripts.

Just so I'm clear, I understand what each of those are (thanks for the comments anyway) but, just not how your getting them ;).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Read the update if you havent noticed I just updated it and you just posted, anyways passwords Rad you can take a look. Its unorganized like hell though, almost everything has its own func xD

Search the document and gl :lmao:

And I got to goto school right now... ><

Edited by Rad
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...