# How to throw an object?

Get help using Construct 2

### » Tue Dec 13, 2011 9:04 pm

How can i throw a object? as in throwing a ball..?
B
30
S
13
G
7
Posts: 740
Reputation: 8,099

### » Tue Dec 13, 2011 9:07 pm

what you mean? just pick up it up and trow it!
.... sorry
B
72
S
22
G
7
Posts: 830
Reputation: 10,214

### » Tue Dec 13, 2011 9:09 pm

Are you joking? or am i being slow..? I mean within construct obviously lol
B
30
S
13
G
7
Posts: 740
Reputation: 8,099

### » Tue Dec 13, 2011 9:15 pm

i joke, but i think you need to be more precise it what you need to happen
B
72
S
22
G
7
Posts: 830
Reputation: 10,214

### » 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
30
S
13
G
7
Posts: 740
Reputation: 8,099

### » 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
B
72
S
22
G
7
Posts: 830
Reputation: 10,214

### » 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
30
S
13
G
7
Posts: 740
Reputation: 8,099

### » 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
B
72
S
22
G
7
Posts: 830
Reputation: 10,214

### » 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
92
S
31
G
24
Posts: 3,191
Reputation: 32,739

### » 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
30
S
13
G
7
Posts: 740
Reputation: 8,099

Next