PDA

View Full Version : Guitar Hero like 3D


random
12-05-2007, 08:20 PM
I am creating a game similar to guitar hero.

If you don't know, the objects move towards the screen on a 3d track.

Picture here: http://www.dignews.com/admin/screenshoot/guitar_hero_12.jpg

I can't seem to get the right feel of depth. Is there a set of rules that will help create the illusion of 3D? Mine doesn't look right.

The notes need to move faster as they move down the track. I can't seem to create a formula that does this correctly...

P.S. The note are being drawn on each frame, based on a time tag.

xxneon
12-05-2007, 08:32 PM
hmm.. my first thought would be to mess with some velocity formulas.. so that as the note gets 'closer' / 'bigger' that the velocity increases..

Lucidity
12-05-2007, 08:32 PM
You'd have to skew the object so the bottom is wider than the top. Then start it at a high position on screen at a small size, and as it moves down on the screen, scale it up. Thats how I would do it, anyway.

Noct
12-05-2007, 08:56 PM
I would suggest reading Senoculars mind boggling 3D tutorial. It is certainly a much bigger scope then what you are talking about it, and parts of it are pretty involved/complicated, but it may well give you a better idea of what you need to do to give that illusion of 3d.

Besides, its an amazing thing to see/read anyway; one of those articles that makes me want to pack it in and give up...

http://www.kirupa.com/developer/actionscript/3dindex.htm

xxneon
12-05-2007, 09:11 PM
this is a VERY sloppy code job here .. so forgive me .. but it seems like the effect is pretty close to what it would look like in guitar hero..

here is the code..

import flash.geom.Point;
var startPoint:Point = new Point(Stage.width*.45,Stage.width*.45);
var endPoint:Point = new Point(Stage.width*.25,Stage.height);

moveTo(startPoint.x,startPoint.y);
lineStyle(1,0x000000);
lineTo(endPoint.x,endPoint.y);

attachMovie("n","n0",0,{_x:startPoint.x,_y:startPoint.y});
n0._xscale = n0._yscale = 15;
vel = .25;
scaleDiff = 100-n0._xscale;
startScale = n0._xscale;
n0.onEnterFrame = function(){
this._y += vel;
vel += vel*.035;
var percent = (this._y-startPoint.y)/(endPoint.y-startPoint.y);
this._x = startPoint.x-(startPoint.x-endPoint.x)*percent;
this._xscale = this._yscale = startScale+(scaleDiff*percent);
if(this._y > endPoint.y+this._height/2){
this.removeMovieClip();
}
}
if you dont want to download the example . all you need is a movieclip symbol that has a linkage id of n.
attached is the example fla..

again forgive me for the code.. it can be done without using Points .. and is in dire need of optimizing .. but the visual is pretty close ..