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

#1 2010-07-23 10:05:24

Relinquished_
New Scratcher
Registered: 2010-06-28
Posts: 31

My Snowball Wars V. 2

Currently I'm working on Snowball Wars V. 2.  It is much more advanced then V. 1 and I'm having some slight difficulties. 

If you check out Snowball Wars V. 1, you'll see you can only play with 2 players.  In V. 2, I'd like to add a single player mode.  How do you think I'd go about doing that? 

Also, in V. 2, there's the ability to throw multiple snowballs (once you hit 10 points you throw two and 25 you throw three) and currently, they are costumes, so if you throw two snowballs, if one hits, the other disappears with it.  I'd like make it so if one hits, the other keeps going.

Thanks in Advance!

Offline

 

#2 2010-07-23 11:48:07

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: My Snowball Wars V. 2

Just make two sprites for the snowballs and put the same, or similar, scripts in each. If you want to offset them, just change the costume centers. I'm not sure if that was your issue, but hopefully that helps.

Offline

 

#3 2010-07-23 12:02:54

Relinquished_
New Scratcher
Registered: 2010-06-28
Posts: 31

Re: My Snowball Wars V. 2

coolstuff wrote:

Just make two sprites for the snowballs and put the same, or similar, scripts in each. If you want to offset them, just change the costume centers. I'm not sure if that was your issue, but hopefully that helps.

It helps a lot! thanks!

Does anyone have any ideas how I'd go about a one player mode?

Offline

 

#4 2010-07-23 12:10:44

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: My Snowball Wars V. 2

Relinquished_ wrote:

coolstuff wrote:

Just make two sprites for the snowballs and put the same, or similar, scripts in each. If you want to offset them, just change the costume centers. I'm not sure if that was your issue, but hopefully that helps.

It helps a lot! thanks!

Does anyone have any ideas how I'd go about a one player mode?

You'd have to make an AI, which is tough. Basically you need a bunch of If statements and actions so the CPU player can determine what to do in each situation. For example, if a snowball is about to hit it, move out of the way.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2010-07-23 12:11:08

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: My Snowball Wars V. 2

Relinquished_ wrote:

coolstuff wrote:

Just make two sprites for the snowballs and put the same, or similar, scripts in each. If you want to offset them, just change the costume centers. I'm not sure if that was your issue, but hopefully that helps.

It helps a lot! thanks!

Does anyone have any ideas how I'd go about a one player mode?

You mean so that there'd be a computer player or something of the like? There really isn't any one way to do that, essentially, you need to put a bunch of "if" statements for how it would react in a certain situation.

EDIT: Outposted!

Last edited by coolstuff (2010-07-23 12:11:27)

Offline

 

Board footer