Stop Movement only if .....

Game Editor comments and discussion.

Stop Movement only if .....

Postby paperboy321 » Wed Aug 13, 2008 3:03 pm

I already made it so when u push ctrl it stops all movement :D by puting key down (ctrl)- script editor and i put

yvelocity = yvelocity = 0;
xvelocity = xvelocity = 0;

and it makes it stop, but how to you make it so you only can
make it stop when it is toughting ( coliding repidetly )
the ground or platform :?: :?: :?:


Thanks ahead of time. :D
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby Fuzzy » Wed Aug 13, 2008 9:32 pm

You can simplify those. just put
yvelocity = 0;
xvelocity = 0;


The format is

destination = math formula;

so you dont need that second =

You can do smart programming though and type

xvelocity = yvelocity = 0;

and it works it out from left to right with the final result being that both xvelocity and yvelocity equal zero.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Stop Movement only if .....

Postby Thanx » Thu Aug 14, 2008 8:04 am

On Colision event do
xvelocity = yvelocity = 0;
Try that out! Is that what you wanted? :?: :)
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Thu Aug 14, 2008 9:11 pm

Thanx wrote:On Colision event do
xvelocity = yvelocity = 0;
Try that out! Is that what you wanted? :?: :)


No i wanted it so that you only can push ctrl
( make it stop ( using xvelocity = yvelocity = 0 )
when it is toughting a platform or the ground.
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Thu Aug 14, 2008 9:14 pm

Fuzzy wrote:You can simplify those. just put
yvelocity = 0;
xvelocity = 0;


The format is

destination = math formula;

so you dont need that second =

You can do smart programming though and type

xvelocity = yvelocity = 0;

and it works it out from left to right with the final result being that both xvelocity and yvelocity equal zero.



:?: :?: :?:

ok thanks, but that is not my question
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby Thanx » Fri Aug 15, 2008 9:46 am

ok, I think I get what you want now! :P
Make a variable, maybe called collisioncount
On Create actor
collisioncount = 0;
On Collision event
collisioncount ++;
if(collisioncount = somenumber)
{
xvelocity = yvelocity = 0;
collisioncount = 0;
}
That should do it I think right there somenumber = the number of collisions the actor should go through before stopping.
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Fri Aug 15, 2008 7:12 pm

can u please :D :D show me by making a demo starting with stopping by pushing ctrl and doing that
i dont understand how to make a variable and other stuff like that. :oops:

thanks alot please reply quickly
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby BlarghNRawr » Fri Aug 15, 2008 11:02 pm

so you want ur char to stop on the platform, by pressing ctrl...
but if you press ctrl in the air, nothing happens?
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Stop Movement only if .....

Postby Thanx » Sat Aug 16, 2008 1:34 pm

I realized that I misunderstood you the last time too :oops:
But here's what you wanted, the demo making of your question's answer.
Note 1: Making a variable is done by clicking the variables button in the script editor, then clicking add. There specify name, and type, addictionally wether all actors can use the variable, or only the actor you're working with at the moment.

Note 2: I've changed the way of moving the character, compared to the demos, to make this work. Instead x = x + 5; (or x+=5; ) , to xvelocity = 5; There's another way of doing it, which I only just thought of now, which includes enabling/disabling actions. But this I believe will be better for you, so you get to know some more coding, which will be required if you continue to the more advanced levels... :wink: :)
ctrldemo.zip
The demo. Study! :)
(43.28 KiB) Downloaded 164 times

Note 3: I made 2 extra variables. 1 to make sure the ctrl only takes effect when colliding, 2 so that ctrl actually can stop the actor even if constntly pushing the arrow keys...

Study & enjoy! Hope you understand!
If you ave any questions, or anything you want to do differently, and/or want to know about the second way of doing it, just say so! :wink:
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Wed Aug 20, 2008 1:59 pm

when ever i download it i extrct it and play it but it say u need newer version but i already updated my version. :?: :?: :o :o
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Wed Aug 20, 2008 2:01 pm

blarghNRawr wrote:so you want ur char to stop on the platform, by pressing ctrl...
but if you press ctrl in the air, nothing happens?



:D :D Correct :D :D
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Wed Aug 20, 2008 2:04 pm

paperboy321 wrote:when ever i download it i extrct it and play it but it say u need newer version but i already updated my version. :?: :?: :o :o


( Game Editor 1.3.9 )
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Wed Aug 20, 2008 2:18 pm

paperboy321 wrote:
paperboy321 wrote:when ever i download it i extrct it and play it but it say u need newer version but i already updated my version. :?: :?: :o :o


( Game Editor 1.3.9 )


NeverMind
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby paperboy321 » Wed Aug 20, 2008 2:42 pm

please here is my game i tryed everything to fix it and cant do it can u return fixed version :oops: :oops: ( I got that game from someone else and made big changes. ) :oops: :oops: :oops: THANKS SO MUCH ( Without this forum I would never make a game )

I Do Not Have Screen Shots "Sorry"
Attachments
My Version of FlyWheel.zip
My Game I am Still Working On!!
(1.4 MiB) Downloaded 151 times
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: Stop Movement only if .....

Postby pyrometal » Wed Aug 20, 2008 2:50 pm

Good work! Keep on improving, then you'll se soon enough you'll be able to make your games form complete scratch! Don't ever give up, take as much time as you need to complete these projects, no one is pressuring you right now but yourself. I'll be looking foward to seeing more of your stuff. ttyl

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron