1
Coding / Re: Link Platforms & Bouncing
« on: September 17, 2011, 11:52:59 am »
Im still confused about how this works.
I tried this:
And it seems not to work (unknown variable: dir)
The error is the one i would also suspect to get from your code.
But i'm not able to find out why your programm is fine with your code^^
Please correct if i understood something false:
1) Variables (if not global) are stored for every instance of an object.
2) if i do the following, it should not work:
From my View it looks like your code does something like 2)'s example. I searched the whole code of your project.
dire_x gets no where defined for objLink. If my 1) would be correct, you should not be able to use dire_x in with (objLink) do {}
Sorry if im stupid but my brain does not understand this^^
I tried this:
Code: [Select]
if place_meeting(x+4*dir,y,obj_mp_return) {dir = dir * -1;} else {x += 4*dir;}
with (obj_Link) do {x += 4* dir;}
And it seems not to work (unknown variable: dir)
The error is the one i would also suspect to get from your code.
But i'm not able to find out why your programm is fine with your code^^
Please correct if i understood something false:
1) Variables (if not global) are stored for every instance of an object.
2) if i do the following, it should not work:
Code: [Select]
//i am obj1
thisvar = 123;
with (obj2) do {x += thisvar;}
because im in the with-do i could only use variables known by the instance of obj2. because thisvar is only known by obj1. From my View it looks like your code does something like 2)'s example. I searched the whole code of your project.
dire_x gets no where defined for objLink. If my 1) would be correct, you should not be able to use dire_x in with (objLink) do {}
Sorry if im stupid but my brain does not understand this^^