Students are having a difficult time creating edges for their games. I have read another post by someone else on the teacher forum and looked at their example. However, the example they have posted does not contain a game with edges.
Here is one way of creating edges for a game. The Sprite created is labeled: dooder . This code makes it appear that there edges on the game by not allowing the Sprite to leave the game. If you need to see the full code, just send me a message and I will post it. I don’t know if this is what you mean by “creating edges for their games”.
if (dooder.x < 0) {
dooder.velocityX = 1;
}
if (dooder.x > 400) {
dooder.velocityX = -1;
}
if (dooder.y >400) {
dooder.velocityY = -1;
}
if (dooder.y <0) {
dooder.velocityY = 1;
}
There’s also a built-in command called createEdgeSprites()
that will create a group of edge sprites called edges
and separate sprites for leftEdge
, rightEdge
, topEdge
, and bottomEdge
. It may not be in the toolbox during the lesson, but students can still use it in text mode or by going to full Game Lab.
The example coding for Lesson 18.16 shows edge sprites, but students/teachers are not given any hints as to how to create them. This has been very frustrating for my students (and for me). This is not the first lesson/level with what I think are inadequate instructions or hints to guide students. Why can’t the edge sprites be in the toolbox?
Hi Sheri
Great question. I will forward this on to see if this could be added to the toolbox.
Karen
I agree why is it just like create with out help! I do not like this, this Edge could be a whole lesson.