I've made a walking loop for my character. Now I realise that I need to higher the point where the character should meet the ground. Right now it's kind of floating above the ground and that's not whwt I want. Is it the "z property (player)" I should change then? And if that's the case, why do I get an error when I write?:
EGO.z= -20
I think you've got the right property, but try:
cEgo.z = -20;
Or (works, but isn't the usual way):
character[EGO].z = -20;
I think you want to crop the bottom of your character sprites. The Z property allows flying charatcers such as birds to be scaled properly as the fly into the background.
I put "cEgo.z= -20;" in the gamestart section but all I get is Unexpected 'cEgo'
When I tried "character[EGO].z= -20" I got something like '[' already defined.
What is wrong?
RickJ: Even if I crop it, it ends up a little to high because of the animation.
When you say you put it in the "gamestart section" do you mean between the #define-s? Because it needs to be after the line "function game_start() {" (the bracket may appear on the next line). So it should look something like:
#define sectionstart game_start // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
cEgo.z = -20;
/* stuff */
}
#define sectionend game_start // DO NOT EDIT OR REMOVE THIS LINE
And as for "character[EGO].z = -20" producing a "'[' already defined" error, you probably put "Character[EGO].z = -20", which is inappropriate because AGS is case-sensative, and Character is a struct which you can only define pointers to, where the character array is an array of pointers to objects of the Character type.
[EDIT:]
If you're confused by that last bit, just realize that "character" and "Character" are different (capitalization matters!).
Thanks, monkey_05_06, for reminding me about the brackets! Somehow, I'd managed to put the command between the last bracket and #define sectionend game_start. But now it works fine! I shure will recheck the bracket thing in the future...
Glad I could be of help! ;)
May I announce that that should not work. It should be cEgo.z = cEgo.z - 20.
Elliott:
i = -20;
This will set the variable "i" (or in this case "cEgo.z" - same thing) to -20.
i = i - 20;
// ... is the same as ...
i -= 20;
This will take 20 away from i.
Thus there's a difference, imagine i to be 100. In the first case, i would turn up to be -20. In the second it would become 80.
I think he wanted to make the cEgo.z variable equal -20 in this case, but if he wanted to just position him 20 pixels higher than whereever he was, than your suggestion is right.
Doh, I missed the point, sorry.