Help with a minigame that involves jumping over things

Started by shaun9991, Tue 31/05/2016 16:05:15

Previous topic - Next topic

shaun9991

Hi guys,

I've been working on a little mini-game for Legend of Hand where you have to complete an obstacle course, I'm having trouble getting anything working (to the point where I've deleted all the code and started again).

I've had the main character set on the left hand side of the screen, as a stationary animated object (running animation). The background scrolls in layers to make it look as though he's running along. Objects (logs) then move into screen from the right side and the player has to click (using a full screen transparent gui button) when it's the right time to jump over the log, triggering a jumping animation. If they fail, a trip animation occurs and he's back to the beginning. If they succeed they jump over the log successfully, the log continues moving and another one has already begun to approach.

Does anyone have any tips on how to code this? I've tried timers and object colliding scripts but I've come up with nothing that works effectively.

Many thanks,
Shaun
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Mandle

How about only allowing the collision detection to work if the player character is not in the top-most frames of their jump animation view (maybe like the center frame and one either side)?

shaun9991

Ah, that't a great idea Mandle!! :) Will try it out tonight. Thanks!
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

RickJ

I believe characters have a z-position property that you may find useful.The jump animation would essentially be flat and you would calculate his z position according to the physics of your game world.  I haven't used AGS in a while so please excuse if I remember incorrectly.

Khris

Wouldn't it be best to use the y coordinate instead? That way the character will actually avoid the object, allowing a simple coordinate check to detect a collision.

Grok

I did something similar in Jacqueline White, bad trouble in the Red Desert, see a test movie at the link below.

horsejumping

The horse has 3 modes, running, ducking and jumping. Collision is determined from the x position for the horse compared to the amarillo and the vulture and what mode the horse is in. If the amarillo is within a certain range and the horse is not jumping there is a collision. The same thing with the vulture except that the safe mode then is ducking.

shaun9991

Thanks for your help everyone, much appreciated. In the end I used a combo of all your suggestions and it works well in the end :)
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

SMF spam blocked by CleanTalk