how to change the xvelocity on my actor

Talk about making games.

how to change the xvelocity on my actor

Postby raminkhan » Sat Oct 22, 2011 4:20 am

Ok, I got a ball rolling in x-direction after I hit it I want it to increase its speed than usual how?
raminkhan
 
Posts: 63
Joined: Mon Sep 12, 2011 3:35 pm
Score: 0 Give a positive score

Re: how to change the xvelocity on my actor

Postby skydereign » Sat Oct 22, 2011 5:12 am

I assume you have something moving with xvelocity. In the collision event (or whatever you mean by hit) just increase the xvelocity, for instance:
ball -> Collision with Actor (repeat disabled) -> Script Editor
Code: Select all
xvelocity*=2;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to change the xvelocity on my actor

Postby Wertyboy » Sat Oct 22, 2011 11:27 am

Skyde, can you tell me what does "*" do?
User avatar
Wertyboy
 
Posts: 543
Joined: Tue Jun 15, 2010 12:38 pm
Location: HCM City, Vietnam
Score: 44 Give a positive score

Re: how to change the xvelocity on my actor

Postby lcl » Sat Oct 22, 2011 11:35 am

* means multiplication :D

And when you write xvelocity *= 2 it means the same as xvelocity = xvelocity * 2
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron