Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

tower defense game in ahk?


  • Please log in to reply
33 replies to this topic
nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012

Das ist nicht ich brauche hilfe Spiele eig. mehr eine Tutorial Anfrage, da wir aber grade quasi über ein Tutorial diskutieren sind wir glaube ich im Offtopic richtig. :D


Visit the new forum ahkscript.org.

http://ahkscript.org


nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012

Ach ja es gibt jetzt doch noch kleinere Problemchen die ich erst beheben muss.

Diese und nächste Woche wirds glaube ich nichts es sei denn ihr wollt richtig schrottigen/ unvollständigen / unleserlichen / fehlerhaften Code haben


Visit the new forum ahkscript.org.

http://ahkscript.org


Alibaba
  • Members
  • 435 posts
  • Last active: Nov 19 2014 04:21 PM
  • Joined: 01 Nov 2012
Kein Stress, lass dir Zeit ;)

Find the recent autohotkey version here: ahkscript.org


nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012

Ichsitz immer noch dran sagt mir falls ihr irgendwie durchsteigt.(Ich tus selber nicht mehr):

f:=new game()
 f.World.enemy.Register(New bird())
s:=f.World.enemy.add()
msgbox %  f.world.enemy[s].hp




Class Game{

world:=new this.world1()
Class World1{

__new()
{
this.__ptr:=0
this.startup:=1
}



__get(p)
{
If (this.startup&&p!="prototype")
{
return this[p]:=new this.prototype()
}
}



Class Prototype{


Class GetSet{
__get(p){
If !(p="__ptr"||"offset"=p||"type"=p)
{
If (p="Location")
	return this
Else
	If (this.__ptr+0&&this.offset[p]&&this.type[p])
	return numget(this.__ptr+0,this.offset[p],this.type[p])
}
}

__set(p,s)
{
If !(p="__ptr"||"offset"=p||"type"=p)
{
If (p="Location")
	  return this
Else
	If (this.__ptr+0&&this.offset[p]&&this.type[p])
	    return numget(this.__ptr+0,this.offset[p],this.type[p])
}	
}
}


__get(p){
If !(p~="ptr"||p="GetSetProto"||p="getset")
{
If !IsObject(this.GetSetProto)
	return this[p]:=new this()
Else
{
	this.GetSetProto.__ptr:=p
	return this.GetSetProto.Clone()
}		
}
}


register(class)
{
size:={UInt:4,Int:4,UPtr:A_PtrSize,Ptr:A_PtrSize,Float:4,Double:8,UChar:1,Char:1,UShort:2,Short:2,Int64:8}
If IsObject(this.getsetproto)
	return
this.getsetproto := new this.getset()
this.getsetproto.offset:={}
this.getsetproto.type:={}
this.Length:=0
s:=0
For name,type in class.location
{
	s:=(A_Index)/4
	If !(name~="list")
	{
	this.getsetproto.offset[name]:= this.Length
	this.Length+=size[SubStr(type,1, strlen(type)-(type~=":")+1)]
	this.getsetproto.type[name]:=SubStr(type,1, strlen(type)-(type~=":")+1)
    }
	Else
		this.Length+=size["UPtr"]
}
For name,type in class
{
	If !(name="location"||name="onticfunc"||name="ondrawfunc"||IsObject(type))
	{
	this.getsetproto.offset[name]:=this.Length
	this.Length+=size[SubStr(type,1, strlen(type)-(type~=":")+1)]
	this.getsetproto.type[name]:=SubStr(type,1, strlen(type)-(type~=":")+1)
    }
}
this.protoptr:=DllCall("HeapAlloc","UPtr",DllCall("GetProcessHeap"),"UInt",8,"UPtr",this.Length)
;~ numput(ceil(s),(this.protoptr+0),0,"UInt")
For name,type in class
    If (type~=":")
		Msgbox % SubStr(type,(type~=":")+1) ":" numput(SubStr(type,(type~=":")+1),this.protoptr+0,this.getsetproto.offset[name],this.getsetproto.type[name])
this.__ptr:=DllCall("HeapAlloc","UPtr",DllCall("GetProcessHeap"),"UInt",8,"UPtr",4)
this.ptrsize:=4
Numput(s,this.__ptr+0,0,"UInt")
}


add()
{
ptr:=DllCall("HeapAlloc","UPtr",DllCall("GetProcessHeap"),"UInt",8,"UPtr",this.Length)
DllCall("RtlMoveMemory","UPtr",ptr,"UPtr",this.protoptr,"UPtr",this.Length)
this.__ptr:=DllCall("HeapReAlloc","UPtr",DllCall("GetProcessHeap"),"UInt",8,"UPtr",this.__ptr,"UPtr",this.__ptrsize+A_PtrSize)
numput(ptr,this.__ptr+0,this.__ptrsize,"UPtr")
return ptr
}


}
}
}

class Location
{
1x:="Float"	
1y:="Float"
1zrot:="Float"
1list:="pic.png"
}


class Bird{
Location:= new location()
HP:="UInt:100"
}


Visit the new forum ahkscript.org.

http://ahkscript.org