Hot answers tagged

5

according to http://wiki.scratch.mit.edu/wiki/Script: A script is a collection or stack of blocks that all interlock with one another. The blocks and their order are very important, as they determine how sprites interact with each other and the backdrop. Sometimes, comments are attached to scripts to explain what certain blocks do and what the ...


4

Can you set numerical values for sprites and/or their costumes? There's a variable under the Looks category named costume # that stores the current costume number of the sprite. You can use variables under the Data category to play with number either locally (i.e., for a specific sprite) or globally (i.e., among all sprites). Does Scratch recognize values ...


3

In your're script window, when the Scratch game is running, you can actually see what script is running. From this, you can see that the Dragon is not moving to the original position because "when I receive 'MoveD'" script remains active, even after "Hippo" starts to move back. This is, most likely, because the Hippo touches first the Dragon, it sends "...


3

Pay attention to the end of the video, where Prof. Malan explains the purpose of user-defined functions: ... as our programs get much more complicated, and our programs more sophisticated, this technique of ... decomposing your program into smaller functions, each of which call other functions, is a very compelling technique because it will ensure that ...


2

Yes, both are working fine. Don't worry.


2

What you are seeing is subtle problem called a 'race condition' which is encountered quite often in programming, especially in asynchronous programs like yours. At the moment your program is designed so that bolt will remove itself when it touches a bat. The bat also removes itself when it touches the bolt. This should work in theory, but it requires that ...


2

Yes, you can. The final deadline is 31 Dec 2014. pset0 isn't submitted through the submit page. The instructions are listed at the end of the pset. How to Submit To submit this problem set, head to the URL below. https://x.cs50.net/2014/psets/0/ You’ll find that a few questions await. Be extra-sure that your answers are correct, particularly your email ...


2

The problem is caused by "Sprite 21". There's a script that says forever if disappear is 18 broadcast "block-disappear" The problem is that even after the message is broadcasted, disappear is still 18 and the forever block is still working.


2

The problem is that the condition Lifes = 0 is only checked once, when the game starts. At that point in the game Lifes = 3, always, so the first condition is ignored because it is false, and the else statement is triggered, which leads to an infinite loop for the rest of the game. In order to fix your script, you must check if Lifes = 0 throughout the ...


1

if you change the code for adding plus one to the score from the cat sprite to fish sprite under when recieve eated it works as desired Here is a screen dump of what i mean


1

You can try out something like this: Let me know if it worked!


1

If you want the cat to move when the lioness moves, you need to broadcast an event. Broadcast an event whenever the lioness moves, and in the cat tab, whenever you receive that event move.


1

In scratch, scripts are the colored blocks which have written command on it. You have to use it to move your sprite ( i.e the character ). The blocks get joined as soon you take them close. In your project it means you have to use at least three scripts ( i.e blocks) to make your project, to make your character move.


1

You're looking for something like this: What this does is saves the location data before the code executes, then when you wish to restore the positioning, you can hit space and it runs. Also, for debugging you can drag in a block, double click it and it runs (e.g. a Show block). Note that the blocks on the reset procedure could simply be on the space bar, ...


1

forever loop was the solution.


1

It looks like you have the command to stop the script when Game Over is heard in more than one place (on Shark2, Fish2 and the stage) so you're probably having problems with one sprite ending the entire script before another one has finished all of its instructions; like changing colour for example. Since 'stop all' kills everything as soon as it is ...


1

you can always get a picture of one and import it as a sprite. I designed a couple of the sprites in mine, search for the picture you want, download it, and then in Scratch go to 'Sprites:' at the bottom, you will see at the top-right of that panel there is a little face, a brush, a folder, and a camera. Those allow you to: select a sprite from the library, ...


1

Why not try to use the offline version? Could be much better. I am using that one and its been flawless.


1

I did Scratch in Firefox in Linux. I don't use Windows, but 2 things I would check are: Make sure Firefox is up to date. Make sure Adobe Flash plug-in is up to date.


1

In the editor window, you can always move sprites around with them mouse in order to set their initial position. This is because you are the programmer, and you are editing the sprites. However, outside of the editor, you can only interact with the program in ways that are defined by blocks. In the program window, you are the user, and you are not allowed ...


1

https://scratch.mit.edu/ The site basically contains various of programs peoples have done before in scratch. It can give you a basic idea of what you may try next. Remember, practice plays important role in learning to code. Have fun coding :)


1

Place the play sound piece before the forever loop!


1

It's very okay to borrow code snippets and from other works but don't forget forget to give credit and source links. It is reasonable and not against CS50 Honour Code to do so. As per CS50 Honour Code: Incorporating a few lines of code that you find online or elsewhere into your own code, provided that those lines are not themselves solutions to assigned ...


1

If what you want is to upload an image to use it as background, you only have click on the small icon Upload backdrop from file on the left side of the screen under the tex New backdrop, next the sprites list. Once uploaded the edit tab will open, and with the editor you can select the image and resize it to fit the screen. Otherwise if what you want is to ...


1

It depends on the license the image falls under. Some images are free for personal use but they usually require you to give credit to the owners of the images. It's better and less time consuming to go to photo resource pages rather than Google so that you can see immediately what the licensing requirements are to use the image. Flicker for example allows ...


1

I'm guessing you would need to simulate the acceleration due to gravity. Your algo would have to accelerate the ball towards the bottom the equivalent of 9.8 m/s for each second of horizontal flight. Or if you just want to "fake it", make your ball rotate a bit for each second of flight and just keep the ball traveling in a straight line along that rotating ...


1

If you feel you understand the basics of scratch and are therefore ready to explore C programming, you can. But if doing this course with the expectation of receiving the certificate, the scratch problem set is MANDATORY!


1

All the bats are receiving the event broadcast by the bolt, which is correct. You need a way to filter which bat specifically is being hit by the bolt. Your current solution using the cloneID to recognise which bat is being hit, could be made work, but there is a much easier way. Suppose the bat were to respond to the hit event by checking if it is ...


1

Unfortunately, yes! Per the course syllabus page Certificates Students who earn a satisfactory grade (60% or higher) on every one of nine problem sets and on a final project will receive an honor code certificate from HarvardX as a downloadable, printable PDF. However, I was once in a similar situation since I also had a prior programming experience, but ...


1

This needs a bit of physics knowledge. It should be basically easy though! Let's imagine how gravity affects the ball in real life! I'm not sure the following will be 100% correct since I haven't studied physics in years As I hit the ball up when it's going down, it starts moving up. It's velocity as I hit it is 0. It then increases, let's say (...


Only top voted, non community-wiki answers of a minimum length are eligible