Page 1 of 1

Some simple questions for my game.

PostPosted: Thu Aug 16, 2012 10:22 pm
by supatails
Hey guys, I was a part of this forum back in about 2006 or 2007, I was about 13 then, I'm surprised most of you are still active. XD Now I'm 18 and I'm attempting to pursue game-design as a career, but I gotta start somewhere so I'm creating an experimental game, mostly as a learning experience for myself to ease my right-brained mind into the realm of coding. I have good experience with modelling, texturing, mapping, etc. I just struggle to no end with code so hopefully I can learn alot within the next year or so. Anyway, I have started with a basic character who has the ability to walk and jump from left to right using the State Method following the tutorial on the Game Editor Wiki.
My Questions:
1. For aesthetic purposes, I want the player to bounce upon hitting the ground. The effect i get with a collision>physical response> both actors, is perfect when falling with the exception of the weird vibrations. What can I use to achieve a nice mild bouncy effect upon colliding with the top of a surface?
2. I want the view to follow the player with a slight delay. I can't do this by parenting I'm pretty sure, so how can I set it up with a timer in script editor if necessary? Basically, you press the right key, the player moves and about a second and then the view follows, just for aesthetics.
Thank you guys! :D

Re: Some simple questions for my game.

PostPosted: Mon Aug 20, 2012 3:46 pm
by savvy
For the second thing, you need to make it so the viewfollows the character after a certain amount of movement yes? so use...

Code: Select all
if(view.x+(view.width/2)<player.x-5)view.x+=speed;
if(view.x+(view.width/2)>player.x+5)view.x-=speed;
if(view.y+(view.height/2)<player.y-5)view.y+=speed;
if(view.y+(view.height/2)>player.y+5)view.y-=speed;


the +/- 5 is the distance until the view starts following, the speed is the speed with which the view follows and the width/height is because the view coordianates start in it's top corner, adding half the width/height centres the location to the middle of the view.
There are more ways to do this, you should experiment with the code!

savvy

Re: Some simple questions for my game.

PostPosted: Wed Aug 22, 2012 5:40 am
by supatails
Thank you so much for the help savvy!