How to throw an object?

Get help using Construct 2

Post » Tue Dec 13, 2011 9:04 pm

How can i throw a object? as in throwing a ball..?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Tue Dec 13, 2011 9:07 pm

what you mean? just pick up it up and trow it!
.... sorry
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Dec 13, 2011 9:09 pm

Are you joking? or am i being slow..? I mean within construct obviously lol
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Tue Dec 13, 2011 9:15 pm

i joke, but i think you need to be more precise it what you need to happen
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Dec 13, 2011 9:18 pm

Well I want to replicate the throwing of a object with physics..

So when picked up the ball or objects velocity would accelerate depending on the mouses velocity.

Im surprised this has not been done yet, has it?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Tue Dec 13, 2011 9:29 pm

every 20ms
oldx var = set to mousex
oldy var = set to mousey

var distancspeed = distance(oldx,oldy,mouse.x, mouse.y)
var shootangle = angle(oldx,oldy,mouse.x, mouse.y)

on mouse release

create a object (physic) at cursor
set force
100 * distancespeed
at angle
shootangle

vtrix2011-12-13 21:43:28
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Dec 13, 2011 9:31 pm

hmmm, Sounds complicated. The thing is, i know how to do this programatically in my programming languages, i just cannot figure out how to do it in a software thats meant to be easier :p
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Tue Dec 13, 2011 9:43 pm

i cleaned it up a bit, i will try it myself now :)vtrix2011-12-13 21:44:06
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Dec 13, 2011 9:46 pm

To throw a ball, the easiest way it just to apply an impulse at angle. Have you read the physics tutorials?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Dec 13, 2011 10:36 pm

Yeah I have read the tutorials.

But will the apply impulse at angle work?

Will its velocity change according the mouse'
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests