YesNoOk
avatar

Helper-Type Projectile > How to bounce off ceiling? (Read 1224 times)

Started by Redash, June 15, 2018, 01:49:55 am
Share this topic:
Helper-Type Projectile > How to bounce off ceiling?
#1  June 15, 2018, 01:49:55 am
  • avatar
  • **
    • Singapore
Hi,

I manage to learn how to code my Helper-Type projectile to bounce off ground and the 2 sides of walls but there seem to have no code to detect the ceiling?

Is there any special way to detect the "top of the screen"?
Re: Helper-Type Projectile > How to bounce off ceiling?
#2  June 15, 2018, 02:06:14 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
trigger1 = ScreenPos Y + Vel Y <= 0 ought to do it for the top of the screen.
Re: Helper-Type Projectile > How to bounce off ceiling?
#3  June 15, 2018, 02:49:37 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Helper-Type Projectile > How to bounce off ceiling?
#4  June 16, 2018, 02:06:31 pm
  • avatar
  • **
    • Singapore
Thanks XGargoyle, now I finally knew why TopEdge isnt working, I am using 1.0 without realisation (>_<)
And thanks much to Jesuszilla, trigger1 = ScreenPos Y + Vel Y <= 0 solved my problem cleanly.

Btw, dun mind me to ask here (Do let me know if a new thread is required.)  share how to detect bottom of screen as well?
I had tried the formulas below but none of them work
Pos Y >= Pos Y - ScreenPos Y + GameHeight
Pos Y >= ScreenPos Y
Pos Y > GameHeight - ScreenPos Y

Further Advice most appreciated.
Re: Helper-Type Projectile > How to bounce off ceiling?
#5  June 16, 2018, 03:09:37 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Bottom of the stage is Pos Y + Vel Y >= 0. Bottom of screen is ScreenPos Y + Vel Y >= GameHeight.
Re: Helper-Type Projectile > How to bounce off ceiling?
#6  June 18, 2018, 02:25:33 pm
  • avatar
  • **
    • Singapore
Jesus Chris! It worked! Thanks you much Jesuszilla! Bless u!