Topic:   Tanks & Projectiles   (Read 9311 times)


0 Members and 1 Guest are viewing this topic.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Tanks & Projectiles
« on: March 29, 2010, 10:39:06 PM »
I've been looking around in Google because I wanted to try to make a tank battle game. 2 tanks fire back and forth until someone is blown up.
I was looking for a good way to simulate the projectiles and i found this page.
 
http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap02/projectile.html
 
I bring it up because I wanted to know if these functions will work in SC yet. If not I'm sure there are simpler ways but this would be realistic.
Also I know Gandolf was looking at physics.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: Tanks & Projectiles
« Reply #1 on: March 30, 2010, 12:35:20 AM »
Woah. That seems to be some sort of trig. Gan can help you simulate that, but the problem with that is declaring the variables. Unless you look at that and can tell how to declare each thing. You won't be able to declare the varibles.


EDIT:

I didn't scroll down, seems simple as long as you know your formulas.
« Last Edit: March 30, 2010, 12:38:37 AM by Gnome_Again »
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Tanks & Projectiles
« Reply #2 on: March 30, 2010, 12:39:06 AM »
SilverCreator has the extra Trig commands now so you can do all that fancy stuff.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Tanks & Projectiles
« Reply #3 on: March 30, 2010, 09:32:07 AM »
that stuff is to fancy for me, i just go with:

let fall=power   //-100, so projectile will go up
let weight=3    //how fast it falls on y axis
let speed=speed    //how fast it travels on x axis

let grav=grav-weight
let fall=fall-grav
if speed> 10 then let speed=speed-weight  //add a speed limit so it doesnt end up taveling in the opposite direction
pushsprite projectile, speed, fall
« Last Edit: March 30, 2010, 09:32:46 AM by EqwanoX »

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Tanks & Projectiles
« Reply #4 on: March 30, 2010, 10:58:55 AM »
Yeah. There's usually no need to get really fancy. Keep it simple. It will run faster, be less code, and still probably do what you want.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Tanks & Projectiles
« Reply #5 on: March 30, 2010, 11:05:10 AM »
OP - all the functions used work in SC, all you have to do is translate the code.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Tanks & Projectiles
« Reply #6 on: March 30, 2010, 05:14:58 PM »
ok thanks guys! I think i'll try the simpler method for now, i was just curious.

However, I don't think I'll need to worry about speed too much in this type of game as there isn't much else going on so I may try both methods at some point. ;D
« Last Edit: March 30, 2010, 06:39:41 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/