This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-29 21:50:23

lukanater
Scratcher
Registered: 2007-09-26
Posts: 100+

Advanced Scratch FPS

http://scratch.mit.edu/projects/lukanater/865580

This is my game, Advanced Scratch FPS. Its not a full game yet, but I plan on mixing together this engine as well as my save engine to produce an FPSRPG.  I'll be calling it True Patriot, and it's about five years in the future, a fascist government takes power, you've all heard the story, and you need to rise up, blah blah blah.

That's not what this post is about though, this is about this engine.  I've seen many attempts at 3d engines.  In my opinion (and from what i've seen.) This is the smoothest and fastest.  There is little to no lag. Theres twice as many enemies necessary than in most games, but thats not a big deal.  Other than needing more enemies, there isn't much else to slow it down. The 3d comes from behind the scenes.  Behind the curtain, theres a sort of minimap.  This is a topdown shooter looking thing.  The player has a long red line coming out of them.  If this comes into contact with one of the dots, or enemies, then they are killed (as long as the space key is down.)  Now, how these little dots become visible enemies on the 3d render, is a simple task.  It uses the distance from player to dot to measure the size of the 3d sprite.  Next it uses the direction from the player to the dot to figure out the X position of the enemy.  I used a simple set of blocks for this:

when gf clicked
point towards [dot1]
set [enem1direction] to [direction]
Then I just multiplied enem1direction by 7 and set their X to that product.

I've had no problems so far.  My next goal is AI, this will be simple. If the user is withing X amount of steps from the enemy, then they will begin attacking them.  Maybe I'll even build directional indicators.
Enem1direction is


http://i1049.photobucket.com/albums/s385/xenokstudios/trippinstudios.png

Offline

 

#2 2012-03-01 18:21:33

lukanater
Scratcher
Registered: 2007-09-26
Posts: 100+

Re: Advanced Scratch FPS

Enemies now follow the player at a certain distance. Getting ready for a next release, I've done some cool updates, such as ammo. I'm just going to see if I can build a building of sorts.


http://i1049.photobucket.com/albums/s385/xenokstudios/trippinstudios.png

Offline

 

Board footer