Jump to content
Sign in to follow this  

2D Game Helper

Recommended Posts


I could't create a net thread in the "Example Scripts" forum

The error returned was:

Sorry, you do not have permission to start a topic in this forum


I always wanted to create my own little game, this is my first game project for AutoIt.

My idea ist to create pictures and move them on the GUI. So now i created Functions which help to create little 2D games.



This function defice the rand of the playing field. All Objects can only created in this field an they notice, if they hit the rand. _SetPlayingField(0,0,500,500) set the point to (0|0) and the width and the height to 500


Create a picture on the field.

$testbild=_CreateObject("bild.jpg",100,450,50,50,"test",2) create an object with the image "bild.jpg" the coordinates are x=100 and y=450. At the moment we son't know what the word "test" means but it is not so important.

But the last parameter is important, 0 for example is an Object which can't touch other objects.


With this function xou can check if an object hit another object or the rand. if _ObjectTouch($testbild)=0 (touch nothing=0)


The object is moved on the field: _MoveObject($testbild,"x",10)

The $testbild object is moved on the X-Axis 10 pixel to the right side, but only if it's possibel!

If there is another object on the distance, nothing will happen.


With _DeleteObject($testbild) the objekt will be removed.

All Functions:


; _SetPlayingField()

; _CreateObject()

; _MoveObject()

; _ObjectTouch()

; _DeleteObject()

; _ObjectTouchClass()

; _GetObjectPosition()

; _TeleportObject()

; _ObjectSetPicture()

; _ObjectSetClass()

; _ObjectSetTyp()

; _ObjectTouchObject()

; _SetObjectSize()

; _SetObjectGroup()

; _MoveObjectGroup()

; _ObjectGroupTouch()

; _ObjectTouchObjectGroup()

; _ObjectGroupTouchClass()

; _GetObjectGroup()

; _DeleteObjectGroup()

; _GetObjectGroupString()

; _GetObjectGroupArray()

; _TeleportObjectGroup()

; _GetObjectGroupPosition()

; _ObjectGroupSetPicture()

; _ObjectGroupSetClass()

; _ObjectGroupSetTyp()



I created a little Jump&Run game. You can go left/right and jump with space.

(It's like Super Mario)




Here is the Download!

All the descriptions in the script are in german.

Later i must translate them, but at the moment i am unhappy because my code ist to slow.

The code runs every 35 milliseconds and sometime it takes more than 10 msecs to run.

I already replaced "if then else" with switch ot select, because "if then else" is slow.

Sorry for my bad english!

Edited by OgerLord

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.