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.
tower defense game in ahk?
Started by
unknow_user
, Jul 14 2013 06:27 PM
33 replies to this topic
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
#32
-
Posted 07 September 2013 - 12:19 PM
Visit the new forum ahkscript.org.
Kein Stress, lass dir Zeit
#33
-
Posted 07 September 2013 - 01:10 PM
Find the recent autohotkey version here: ahkscript.org
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" }
#34
-
Posted 18 September 2013 - 11:18 AM
Visit the new forum ahkscript.org.