A Physics doubt with speed and angle

Get help using Construct 2

Post » Tue Jun 10, 2014 3:34 pm

Anybody help
Image
B
32
S
7
Posts: 197
Reputation: 2,537

Post » Tue Jun 10, 2014 3:50 pm

Can you post your .capx file?
Visit me at EgoAnt.com
B
51
S
7
G
7
Posts: 78
Reputation: 6,408

Post » Tue Jun 10, 2014 5:40 pm

Here is your example from the other thread modified to work with touch. This has been tested on Crosswalk for Android.
You do not have the required permissions to view the files attached to this post.
Visit me at EgoAnt.com
B
51
S
7
G
7
Posts: 78
Reputation: 6,408

Post » Wed Jun 11, 2014 8:14 am

Thanks a lot for giving a hand. I changed these same things but it didn't work for me.

What did I miss?
Image
B
32
S
7
Posts: 197
Reputation: 2,537

Post » Wed Mar 04, 2015 10:37 pm

@EgoAnt Very interesting solutions. I made front hoops game for the place I'm working on. I had to "fake" perspective and stuff however I'd like to limit my bulit speed to stop it from going too fast. After all people can swipe preety fast but I dont want the ball to "go past the speed where you can't see it. Any ideas...?
I'm attaching the current code in my game. It works but I'd like a bit of controll over the "max" speed of the ball so that it doesnt just go hyperspeed on me.
Any ideas might help.

I have a "shooter"at the bottom that moves side to side with a sine behaviour to make it harder for the player to aim exactly at the hoop which is on the middle of the screen. This is a "front view type hoops". I'm going on production tomorow but I'd like to iron out that issue for future updates to make it cooler.
You do not have the required permissions to view the files attached to this post.
Freefall Bird
B
47
S
9
G
5
Posts: 281
Reputation: 5,803

Post » Thu Mar 05, 2015 4:32 pm

@ragevortex Capping a max value is pretty easy.

On the line where you have:
Set Bullet speed
Code: Select all
touch.SpeedAt(0)+200


Change it to:
Set Bullet speed
Code: Select all
min(touch.SpeedAt(0)+200,300)


If you want to get really fancy, you could create a global variable and name it maxBallSpeed. Then just set that value at the top and it will be easy to maintain.

Set Bullet speed
Code: Select all
min(touch.SpeedAt(0)+200,maxBallSpeed)
Visit me at EgoAnt.com
B
51
S
7
G
7
Posts: 78
Reputation: 6,408

Post » Fri Mar 06, 2015 3:32 pm

@EgoAnt
Thank you for your answers.
I had made an alternate solution by the time but yours are preety clean looking :)
Ball bullet.speed <= 800 | Ball set bullet.speed =800
works just fine in my case.
Freefall Bird
B
47
S
9
G
5
Posts: 281
Reputation: 5,803

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests