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

#1 2013-02-04 16:41:08

jameslister97
New Scratcher
Registered: 2013-02-04
Posts: 4

help!! :)

hello.
I'm working on a school project and i've been asked to create a game using a random dice (which i have done)
there are two characters that start with full strength and skill
and there is a six sided dice
the character that has the highest adds their score to the skill and strength but the person with the lowest subtracts it
when one character reaches 0 on the strength they die but if they reach 0 on the skill nothing happens.

thanks
anything would be helpful  smile

Offline

 

#2 2013-02-04 17:12:55

-Stendika-
Scratcher
Registered: 2009-11-12
Posts: 74

Re: help!! :)

What do you need help with?


http://i1336.photobucket.com/albums/o660/Stendika/gbanner1_zpsd0178027.png
My latest games can be found here. Please view and give feedback!

Offline

 

#3 2013-02-04 19:21:45

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: help!! :)

James, it sounds like your exit condition logic needs to change.
From what you're saying you have two sprites which have an exit condition that looks like this (from player 1's theoretical code):

if < [strength v] = [0] > 
  broadcast [player 2 win v]
end
if < [skill v] = [0] >
  broadcast [player 2 win v]
end
Well I was going to use scratchblocks, however scratchblocks can go throw itself into a singluarity because making it express an "or" condition is rubbish when "<" chars are involved.
psuedocode time!

You should be doing something like this,
IF  sprite1.str < 1 OR  sprite1.skill < 1 THEN sprite2.wins

Now I'm going to go rage in the scratchblocks testing area and hopefully not require a new keyboard afterwards.  smile

Last edited by dechan (2013-02-04 19:48:09)

Offline

 

#4 2013-02-05 11:10:27

jameslister97
New Scratcher
Registered: 2013-02-04
Posts: 4

Re: help!! :)

thank you very much that is very helpful  smile
i just need to know how to code the math of it all  hmm  shouldn't be to hard

thanks again  smile

Offline

 

Board footer