Hi, I'm using a program called FunEditor which compiles in C++. I doubt many people have heard of this program, but if you have, I would appreciate the help.

I'm working on creating a Mario-style platformer game, and am trying to make a function where if the Player collides with a mushroom and presses Space, then the player goes to the "picking" animation, and the mushroom does its own animation. Then, after the player's animation is over, it goes back to the "idle" animation. Also, once the mushroom's animation is over, it will delete.

Here is the code I'm using:

Sprite* Player=This->CollisionWithSpritePtr("Player");
if (This->CollisionWithSprite("Player")) && if (Player* ->Animation(PLYR_MUSHROOM));
This->Animation(MUSHROOM_END);
{
	if(This->EndOfAnimation(MUSHROOM_END));
		This->DeleteFlag(true);
}
if (This->CollisionWithSprite("Mushroom")) && if (pKeyboard->IsPressed(DIK_SPACE));
This->Animation(PLYR_MUSHROOM);
{
	if(This->EndOfAnimation(PLYR_MUSHROOM));
	This->Animation(PLYR_IDLE);
}

And the build errors I'm getting are:
Module Line Error Description
Object Functions / MushroomFN 2 Expression syntax in function MushroomFN[Sprite *]

Object Functions / MushroomFN 3 Undefined symbol 'MUSHROOM_END' in function MushroomFN[Sprite *]

Object Functions / MushroomGetFN 1 Expression syntax in function MushroomFN[Sprite *]

By the way, the first code is MushroomFN, and the second is MushroomGetFN.

Please help!

The error message is pretty clear about what is wrong, and the solution sould be obvious: where did you declare MUSHROOM_END ???

Sorry, I'm still very new to programming.

MUSHROOM_END is an animation for the sprite that the MushroomFN function will applied to.

Previously, the animation change code worked for a similar situation, so I'm still not sure why it isn't working now.

If possible, could you please highlight the errors and explain the corrections I should make?

No I can't because I know nothing about that editor. Go back to where you got it and see if they have a user's group or forum where you can ask questions. My pure guess is that you failed to include some header file(s). Compare your program with the code you said that works to see what it is missing.

Okay, well thanks for trying.
Unfortunately the forum for the program hasn't been touched for a year, with only one thread.

That should tell you that nobody uses that editor. My advice is to scrap it and use something else to write your program.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.