The Daily Click ::. Forums ::. Klik Coding Help ::. Arcing physics
 

Post Reply  Post Oekaki 
 

Posted By Message

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
17th May, 2005 at 23:32:37 -

i am attempting to make a worms type game and am having a little trouble arcing the projectiles right. right now im using something like

-PL1 pressed fire 1
and ("projectile")<1
then shoot ("projectile") towards ("sight")
set Value A("projectile") to X("projectile")
set Value B("projectile") to 24
-X("projectile")>Value A("projectile")
and B("projectile")<>dir("projectile")
every 0'00''10'''
then set dir("projectile") to dir("projectile")-1
-X("projectile")<Value A("projectile")
and B("projectile")<>dir("projectile")
every 0'00''10'''
then set dir("projectile") to dir("projectile")+1

this works but not the way i had hoped. it arcs, but when you fire nearly straight up it doesnt go up, a little over, then down. it just does a huge arc-high and far. also if anyone knows how to make it the longer you hold the mouse the more power is stored up and then it fires when you release would be helpful.

Whatever

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
18th May, 2005 at 00:49:00 -

Use a vector.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
18th May, 2005 at 04:09:05 -

damn what a mess, try not only to improve your spelling but can you make it easier for us to read too

And avoid timer events.

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
18th May, 2005 at 13:29:19 -

I'd have a value for y direction and a value for x direction, when you angle upward make the y value greater than the x value, etc. And make both values higher as for more power. When you fire, create an object and make it move accross x amount and up y amount. Decrease y every so-often so the projectile stops going up and goes down.

Wow, you've inspired me, I feel like making a worms game now!

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
18th May, 2005 at 15:27:40 -

ok. well ill try what ive been given so far. also enemy Ai. how would you make them shoot at a higher angle the farther away the player is.

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
18th May, 2005 at 16:04:07 -

You can get the distance between an enemy and the player by using ABS(X("Enemy") - X("Player")) (this only takes horizontal distance in to account, obviously, and I'm not entirely sure whether MMF has an ABS function or the syntax of it) - how you interpret that distance and translate it in to an angle is up to you, though.

 
http://www.davidn.co.nr - Games, music, living in America

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
18th May, 2005 at 18:29:42 -

well im testing out ideas in TGF and ill upload it into MMF and start over with what i know works from there. but anything will help me at this point since im just starting. make suggestions if you fell like it.


 
n/a

clwe



Registered
  17/12/2002
Points
  702
18th May, 2005 at 19:54:50 -

If you want to get the proper (i.e. point-to-point) distance between two objects, just use Pythagoras Theorem:


Set 'X distance' counter to X player - X enemy
Set 'Y distance' counter to Y player - Y enemy

Set 'X distance' to the power of 2
Set 'Y distance' to the power of 2

Set 'Actual distance' counter to 'X distance' + 'Y distance'
Square root 'Actual distance'


...and that's it. If you're still using TGF, then you'll have to resort to the Advanced Math object. The decimal offset will need to be moved a few places as well (say, 10 to the power of 3), as TGF can't handle decimals.

The proper way to do arcing is by using sin and cos for 360 degree movement. Getting the right effect after that, however, is difficult. I presume. I haven't actually tried it myself =P. Maybe I can come up with something...

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
18th May, 2005 at 20:11:59 -

yes, but when you square the numbers, there are no negatives left.

 
Craps, I'm an old man!

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
18th May, 2005 at 21:26:12 -

well i know how to do arcing with speed and time and trajectory in TI 83+ but thats calculator programming and it has perametric equations that use sin cos and tangents. is there any way to use perametric eqs. in tgf or mmf? if so then id be really happy. for some reason i do better using TI 83 programming then i do tgf and mmf events. theres just something about it.

also can you submit games to DC that arent made with clickteam products? just wondering

 
n/a

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  201

VIP MemberLikes TDCKitty
19th May, 2005 at 01:12:17 -

You can submit none clickteam apps, i've seen it many times. I dunno if you SHOULD...but you can...

you could always make a seperate event for shooting straight up, but hell, if i were you i'd ditch the timed events anyways and start from scratch using trig, I've never actually done that, I know trig but implementing it in MMF sounds too time consuming.

 
thinking is like pong, it's easy, but you miss sometimes.

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
19th May, 2005 at 01:21:08 -

ill just wait until calculus and physics my senior year. but that would delay production by a year.

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
19th May, 2005 at 05:43:17 -

You don't have to - the Internet can teach you more than you think.

 
http://www.davidn.co.nr - Games, music, living in America

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
19th May, 2005 at 13:08:24 -

so can books but i dont like to read. i learn more debating about something than anything else

 
n/a

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
19th May, 2005 at 14:02:37 -

Nobody knows of I (or J) notation?

Or to make things easy multiply the negative figures by -1 before putting them into pythagoraus theorem.

Image Edited by the Author.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
19th May, 2005 at 19:53:17 -

so i could make a game in like dos basic (QBASIC), compile it, then submit it.

 
n/a

clwe



Registered
  17/12/2002
Points
  702
20th May, 2005 at 11:26:18 -

*shrugs* no idea what I or J notation is. Call me biased (or plain ignorant =P) but I feel that there's no point confusing people when you don't need to. Explaining things in simple terms is better than presenting some equation that only makes sense to robots, or those who know how to do the calculation in the first place =P

 
n/a

clwe



Registered
  17/12/2002
Points
  702
20th May, 2005 at 18:19:15 -

Testes?...

Er...anyways, guess that makes more sense now. More so than when I did a Google search.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click