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

#1 2008-03-30 16:43:25

canihaveanother
Scratcher
Registered: 2008-03-27
Posts: 4

Making a defense game

Alright, I love defense games like Protector and Desktop Tower Defense 1.5 and I'm trying to make my own with Scratch. It's my first project so I'll probably keep going here with new questions, but right now, the most pressing one is:

How do I script a sprite so that it changes costumes depending on where another sprite is? What I want is for the gun on my turret to move based on the position of its target. I've tried my own scripts, but none of them work right. Please help!

Last edited by canihaveanother (2008-03-30 16:45:00)

Offline

 

#2 2008-03-30 16:55:23

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Making a defense game

Rather than change the costume, use "point in direction of" to point at the chosen sprite.

But I have to say, you have chosen quite a difficult 1st project - defense games with auto-firing towers can be quite a challenge - I have not seen a good one yet, on scratch.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-03-30 17:13:37

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Making a defense game

Defense games would be very difficult to make in scratch mainly due to the lack of sprite duplication. Most games like this I've seen have many sprites on the screen at a time.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#4 2008-03-31 13:51:38

canihaveanother
Scratcher
Registered: 2008-03-27
Posts: 4

Re: Making a defense game

Alright I actually have not just a cannon type gun but a sort of tower, so I had to make the actual gun part a separate sprite, but in looks okay now. Thanks for the help everyone; be back probably soon with more questions!

Offline

 

#5 2008-03-31 13:56:11

jkingshooter
Scratcher
Registered: 2008-02-12
Posts: 100+

Re: Making a defense game

you would need a lot of sprites or make the enemies hard to kill for a def. game


(\_/)     
(0.0)
(> <)
^^ ^^ www.freewebs.com/redstargames http://www.freewebs.com/lol-theshow

Offline

 

#6 2008-03-31 14:27:18

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Making a defense game

I wonder if it would be possible to fake "crowds" of enemies usign costumes. 

Costume 1:

O  O  O
O  O

Costume 2:

O O
O O

etc.

As long as the rotatiojn point is right at the back of the costumes so that it appears that the enemy at the front is the one getting shot...


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#7 2008-03-31 14:38:26

jkingshooter
Scratcher
Registered: 2008-02-12
Posts: 100+

Re: Making a defense game

thats a good idea try that...


(\_/)     
(0.0)
(> <)
^^ ^^ www.freewebs.com/redstargames http://www.freewebs.com/lol-theshow

Offline

 

#8 2008-03-31 14:39:26

canihaveanother
Scratcher
Registered: 2008-03-27
Posts: 4

Re: Making a defense game

Is there a way to enable more fonts/font sizes in the editor mode? It's driving me crazy!

Last edited by canihaveanother (2008-03-31 14:40:52)

Offline

 

#9 2008-03-31 14:40:38

canihaveanother
Scratcher
Registered: 2008-03-27
Posts: 4

Re: Making a defense game

Mayhem wrote:

I wonder if it would be possible to fake "crowds" of enemies usign costumes. 

Costume 1:

O  O  O
O  O

Costume 2:

O O
O O

etc.

As long as the rotatiojn point is right at the back of the costumes so that it appears that the enemy at the front is the one getting shot...

That's a cool idea. I'll try that (eventually). I'm just working on making the basic mechanics work and look right (1 enemy, 1 turret) .

Last edited by canihaveanother (2008-03-31 14:41:35)

Offline

 

Board footer