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

#1 2009-01-15 18:01:04

Police
Scratcher
Registered: 2008-12-29
Posts: 8

Simpler Codes

I Was Thinking About Making A Topic Where People Can Ask For Simpler Codes For There Game And It Does The Exact Thing You Want Them To Do. For Example:
[Blocks]
<when green flag clicked>
<forever if><( <{ Lv. }><=> 1 )>
<set{ Max HP }to( 11 )>
<end>
<when green flag clicked>
<forever if><( <{ Lv. }><=> 2 )>
<set{ Max HP }to( 12 )>
<end>
<when green flag clicked>
<forever if><( <{ Lv. }><=> 3 )>
<set{ Max HP }to( 13 )>
<end>
[/Blocks]
Why Not Do:
[Blocks]
<when green flag clicked>
<forever>
<set{ Max HP }to( (( <{ Lv. }> <+> 10 )) )>
<end>
[/Blocks]
(I Suggested That To A Project called Stick RPG. He Had 1-18 Of The First Example.)
So Here's Where You Can Help People Make Simpler Codes or Ask For A Simpler Code!


We The Scratch Police,CIA, and Secret Police(not so secret though lol)
Will Keep Scratch A Great Place For All Scratchers! Scratch On!

Offline

 

#2 2009-01-15 20:02:39

Kezio
Scratcher
Registered: 2008-11-26
Posts: 100+

Re: Simpler Codes

bump this may be a good idea.

<when green flag clicked>
<forever>
<set{ X }to( (( X <*> 0.8 ))
<end>

Offline

 

#3 2009-01-15 20:26:00

SImniel
Scratcher
Registered: 2008-09-27
Posts: 100+

Re: Simpler Codes

Probs you can use  my way of getting my HP (I will change the END stat to LVL stat)
[blocks]
<when green flag clicked>
<forever>
<if><( <{ Experience_Numerator }> <>> (( <{ Experience_Denominator }> <-> 1 )) )>
<broadcast[ Level UP
<change{ Level }by( 1
<end>
<end>

<when I receive[ Level UP
<set{ HP_Denominator }to( (( HP_Denominator <*> Level ))

[/blocks]

But of course you gotta start your game with a HP_denominator value or it wont work.

this is just another way i figured out... depends on how you want your game to work out.

Offline

 

#4 2009-01-15 23:02:11

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Simpler Codes

SImniel wrote:

Probs you can use  my way of getting my HP (I will change the END stat to LVL stat)
[blocks]
<when green flag clicked>
<forever>
<if><( <{ Experience_Numerator }> <>> (( <{ Experience_Denominator }> <-> 1 )) )>
<broadcast[ Level UP
<change{ Level }by( 1
<end>
<end>

<when I receive[ Level UP
<set{ HP_Denominator }to( (( HP_Denominator <*> Level ))

[/blocks]

But of course you gotta start your game with a HP_denominator value or it wont work.

this is just another way i figured out... depends on how you want your game to work out.

[blocks]
<when green flag clicked>
<set{ HP_Denominator }to( 1 )>
<forever>
<if><( <{ Experience_Numerator }> <>> (( <{ Experience_Denominator }> <-> 1 )) )>
<broadcast[ Level UP
<change{ Level }by( 1
<end>
<end>

<when I receive[ Level UP
<set{ HP_Denominator }to( (( HP_Denominator <*> Level ))

[/blocks]

Like That? And This Is Not My Game. I'm Just Making A Place Where People Can Ask For Simpler Codes and We Give Them A Simpler Code Or Tell Them Thats The Only Way.

Off Topic: I Think Some People Are Crazed Out That The Police Are On The Forums (I'm The User Police) I Don't Even Know Why I Created That User... Who Cares If I Delete It A Police Group Is Gone...Which Is.. Bad? Maybe I Could Make A Suggestion That You Can Merge Your Other User With Your Main One. If They Do The Thing I Want...

Offline

 

#5 2009-01-16 13:35:47

onedudeuk
Scratcher
Registered: 2009-01-11
Posts: 100+

Re: Simpler Codes

Brilliant!*Bumps thread*

________________________

http://scratch.mit.edu/projects/onedudeuk/382730


http://i.imgur.com/1FaX3.gif
http://i.imgur.com/yu0s1.gif

Offline

 

#6 2009-01-16 15:12:25

Kezio
Scratcher
Registered: 2008-11-26
Posts: 100+

Re: Simpler Codes

Maybe you can use this for stats!

<when green flag clicked>
<set{ level }to( 1
<forever>
<set{ Health }to( (( level <*> 0.8 ))
<end>

Last edited by Kezio (2009-01-16 15:12:43)

Offline

 

#7 2009-01-16 16:03:10

Police
Scratcher
Registered: 2008-12-29
Posts: 8

Re: Simpler Codes

Look Its Not My Project.. This Is So People Can Ask For Simpler Codes. So You Don't Have A HUGE Mess in the scripting area...


We The Scratch Police,CIA, and Secret Police(not so secret though lol)
Will Keep Scratch A Great Place For All Scratchers! Scratch On!

Offline

 

#8 2009-01-17 08:39:59

SImniel
Scratcher
Registered: 2008-09-27
Posts: 100+

Re: Simpler Codes

Police wrote:

Look Its Not My Project.. This Is So People Can Ask For Simpler Codes. So You Don't Have A HUGE Mess in the scripting area...

We know that, we are just helping out =]

Offline

 

Board footer