Jump to content

Eigensheep

Active Members
  • Posts

    62
  • Joined

  • Last visited

Profile Information

  • Location
    Salisbury

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Eigensheep's Achievements

Wayfarer

Wayfarer (2/7)

3

Reputation

  1. Thanks for the feedback UEZ! I'll take a look at using Beep() to generate some sounds for it... Glad you enjoyed playing wakillon
  2. Hello everyone, Just a little recreation of the Space Invaders game. I'm sure it's been done before (?) but it's good practice to do it myself! There's no sound because I wanted to try to keep it to a single .au3 file and I'm pretty sure you can't generate your own sounds. The controls are: ENTER - play game LEFT/RIGHT - move left or right SPACEBAR - fire Any ideas on how to optimise it would be great, I wanted to add the barriers that you usually get to hide behind but it was becoming too slow. And of course, if I've got any rules wrong then feel free to correct it... space invaders v2.au3
  3. Ok, so I realise AutoIt is a bad choice for gaming. But I've been working on this for a while now, and feel that the project is near completion so I thought a couple of you guys might have fun testing it. It's basically a mario-like game that I've based heavily on a version I played online a while back. I'd been messing around with GDIPlus and game creation in AutoIt for a bit over the Summer and made simple things like space invaders, etc. so I thought I'd take this on as a challlenge. Well, here's the result. The controls and objectives are all explained in the game so I'll not waste time and post them here. I'd appreciate any comments, suggestions, bugs and ideas for improvement. I'll apologise for the fairly messy code now. I'm also not sure of the name, I've called it "Balls In Space" but this is in fact the name of the game I based it on and I'd like something more appropriate and original so if any creative people have an idea, I'm open to suggestions. One more thing - it should be obvious, but to run the game, it's MainGUI.au3. It has only one level at the moment, but there's a text file in the levels folder that describes how to add more. You can do this to your heart's content. And you can change the game in any way you like, but please do mention my work if you show it to anyone Oh, and for competitive people, with practice I can get a score of 1000. 920 is also pretty good. Balls In Space.zip
  4. I think I've found a solution. First I shortened some of my longer variables (this is surprising news!) and that made a small difference, BUT then I realised that because I was taking some variables from an external file, they were all being read as string type, so in expressions such as "If $var Then" later on, even if $var was "False" then the code was executed. This made a huge difference - it cut down the average time for one of my functions from 250ms to 79ms (according to timerdiff)... Now I know to make sure my variables are of the right type in future. Thanks for the tips though, I'll bear all of it in mind for future scripts.
  5. That doesn't seem to have made a difference. The variable $split[1] comes from a FileReadLine() and the file is closed after the Switch loop, would this make a difference? And Info, I'll bear that in mind - how long is long? Thanks for the help guys.
  6. Ok, I am genuinely confused by this. I'm using GDI Plus to draw images to the screen and then "moving" the images by redrawing them in GDI+. But the problem is that the script slows depending on how I define my initial variables and I don't see why - Like this, it's a useable script, reasonably fast and responsive ("local" here is the global scope, so I don't think memory is the problem) Local Const $Width = 700 Local Const $Height = 650 Local Const $fog = 8 Local Const $n_blocks = 30 Local Const $tilt = $Pi/5 Local Const $bgcolor = "F0506070" Local $dot_distance = 50 But like this and the whole script becomes around 3 seconds slower for every action Switch $split[1] Case "fog" Global Const $fog = 8 Case "n_blocks" Global Const $n_blocks = 30 Case "bgcolor" Global Const $bgcolor = "F0506070" Case "sphere_image" Global $sphere_image = @ScriptDir & "\images\sphere.gif" Case "sphereR0" Global $sphereR0 = 255 Case "sphereG0" Global $sphereG0 = 255 Case "sphereB0" Global $sphereB0 = 90 EndSwitch And, of course, I wanted to use the latter. Any ideas what I can do?
  7. Thanks guys, some interesting thoughts. I think practically M23's solution works best, but in my file the executable code is so short I might be better off to just separate the cases and repeat it. But perhaps for longer sections of code...? Thanks again!
  8. Hi all, Just a quick question; is there a way of having a conditional ContinueCase statement? What I mean is that if I have "Case 1,2,6...." and then "Case 2,3,4" and "Case 1,5" later on in a switch, is there a way I can get autoIt to execute both applicable statements if the value is 1 or 2 (in this example)?? That seems poorly phrased even though I'm english, I hope you can understand my question! Thanks in advance.
  9. Umm, this is awkward. I removed the " & " in each string and now it works. Sorry to have wasted your time, I hope this can help someone else in the future!
  10. Hi guys, firstly sorry for creating another thread. But I can't solve my problem using solutions posted in the forums. So I have this script: $file = @ScriptDir & "\files\tst.au3" $directory = _GetDirPath($file) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\Aut2exe.exe", $directory) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\Aut2exe_x64.exe", $directory) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\AutoItSC.bin", $directory) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\AutoItSC_x64.bin", $directory) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\Notes.ico", $directory) FileInstall("C:\Users\Jordan\Documents\Autoit Files\Encryption" & "\upx.exe", $directory) ShellExecuteWait(@ScriptDir & "\files\Aut2exe.exe", '/in "' & $file & '" /icon "' & $directory & 'Notes.ico"') FileDelete($directory & "Aut2exe.exe") FileDelete($directory & "Aut2exe_x64.exe") FileDelete($directory & "AutoItSC.bin") FileDelete($directory & "AutoItSC_x64.bin") FileDelete($directory & "Notes.ico") FileDelete($directory & "upx.exe") Func _GetDirPath($filepath) $i = StringInStr($filepath, "\", 0, -1) Return StringMid($filepath, 1, $i) EndFunc And when I compile I get the notorious error; "Invalid FileInstall() function:" The files exist, are in the location specified, and I HAVE used a literal string as the first parameter of each call to the function. I also replaced all / with \ as suggested, but this hasn't solved it either. I get no such problem running the script normally. Can someone please explain what's going on? Many thanks.
  11. Hi, just a quick question.... What's the equivalent way in autoit of "For Each cell In Application.Selection" in a macro? And if possible, is there a way of restricting this to just one column of the selection, because I need to be able to do both. Thanks in advance
  12. Hi, is there any way to find the first letter not between two <>? So if I had the string <ab>/<cd>efg can I easily get the 'e' without checking every result from StringRegExp? The example seems easy, but my problem is that there could be other things in between the > and the letter, like numbers or / or ^, etc... so it really is just the first letter. Thanks!
  13. 29 Downloads, 109 views and only 1 comment?
  14. Thanks! Glad you liked it.
  15. Another editor, and nothing special. I just thought it finally warranted posting. I still use SciTE by preference. But on computers where AU3 is not installed (eg. at school) I have a copy of the autoit directory and this on my USB stick. The screenshot below should show what it looks like. Features: Text editor New,Open,Save Compile Run Error check Beta/Production Switch "No save" option - the file is not saved before running/ compiling/ error checking Version checker (top right) with website link Multiple "Tabs" New, Next, Previous, Close, Save Some problems I am aware of are: Empty files reading "0" on tab-change and unknown errors on opening some files. You also need SciLexer.dll to run it (not posted, but readily available.) I would be really grateful for any comments/ problems/ ideas/ improvements. Oh and btw, the files "highlighter.au3.txt", "Scintilla.h.au3" and "SciteInclude.au3" should go in the same directory as the main file. I didn't write all of it, just some, but I forget where I found the code - so if it was you then thank you! Let me know and I can put your name in somewhere. Also, the "windows" in the filename doesn't refer to the OS. It's my way of differentiating versions. The source is long which is why I haven't posted it. (But it is included in the zip) Editor.zip
×
×
  • Create New...