left scrolling background images to imitate actor movement
Gaming Mom here with a homework assignment from the boy...
My son is creating a right scrolling airplane game that shoots bullets. Right now he is working on the background images. He has chosen a blue color as his scene background. He added little white clouds that are moving from left to right (stacked and relative to actor) by basically following the cannon physics template logic. It works. They move at a constant speed regardless of the airplane's movement.
He has a middle ground and a foreground, too. He wants them to move at different speeds to simulate a moving plane. He's having a problem with a few things, though.
1. His airplane appears at the beginning of his scene (on the left side) simultaneously as it leaves the right side of the screen.
2. When he tried to set up middle ground movement using move or move to behaviors and "self.Motion.Linear Velocity.X to -20" relative to actor and 'stacked' just like in the clouds, his middle ground doesn't move, only one cloud moves, and his plane doesn't move either.
We have looked at the tutorials and aren't sure how to set up additional actor attributes to get the equations to work properly. We see with the templates that we've tried to copy, how the GS coders all do this. But we don't understand why this has to be done and how it makes the equations work. Any simple advice geared toward an elementary school kid would be really helpful. He's a pretty logical kid and loves the challenge. We're not looking to sell apps on Amazon or the Apple Appstore. I might have a future programmer on my hands and I just want to foster his development even tho it is a bit beyond my grasp
My son is creating a right scrolling airplane game that shoots bullets. Right now he is working on the background images. He has chosen a blue color as his scene background. He added little white clouds that are moving from left to right (stacked and relative to actor) by basically following the cannon physics template logic. It works. They move at a constant speed regardless of the airplane's movement.
He has a middle ground and a foreground, too. He wants them to move at different speeds to simulate a moving plane. He's having a problem with a few things, though.
1. His airplane appears at the beginning of his scene (on the left side) simultaneously as it leaves the right side of the screen.
2. When he tried to set up middle ground movement using move or move to behaviors and "self.Motion.Linear Velocity.X to -20" relative to actor and 'stacked' just like in the clouds, his middle ground doesn't move, only one cloud moves, and his plane doesn't move either.
We have looked at the tutorials and aren't sure how to set up additional actor attributes to get the equations to work properly. We see with the templates that we've tried to copy, how the GS coders all do this. But we don't understand why this has to be done and how it makes the equations work. Any simple advice geared toward an elementary school kid would be really helpful. He's a pretty logical kid and loves the challenge. We're not looking to sell apps on Amazon or the Apple Appstore. I might have a future programmer on my hands and I just want to foster his development even tho it is a bit beyond my grasp
Best Answers
-
RThurman Posts: 2,881
How exciting for you! For obvious reasons, this reminds me of my experiences with one of my children who seemed to take a real interest in programming while still in elementary school. I was very concerned that I would push too hard, or (by parental bungling) make learning to program so frustrating that he would give up before he gave it a good shot. My solution was to never teach anything! Instead, I'd wait until he indicated an interest in a topic by his asking, "how do I . . . ?" Then I would only explain exactly what he wanted to know. (No more and no less.) It seemed to work for him. (He just submitted the first draft of his masters thesis in computer science yesterday!) Now I am the one asking, "how do I . . . ?"
1) For issue #1 it sounds like he has scene wrapping turned on. Go to Scene -->Attributes and then uncheck "Wrap X"
2) For issue #2 it might be that he has unlocked a single instance of an actor (on the stage), and this single cloud is the only instance with the movement behaviors in it.
Hope that helps!
-
mynameisace Hull, UKPosts: 2,484
Sounds like you need a parallax template. Lucky for you, I made just that ha
http://ellerker.net/files/GSParallax.zip
The movement wants to be tied to the camera, not the players x and y.
Ace
Answers
He gets out of school in an hour and is on holidays until the middle of April. All he could think about before he left was getting his game sorted out. LOL. The parallax template is going to really help him sort out his logic and get his project going to the next level-- without much imput from me, thankfully-- because I'm afraid I would do more harm than good. He loves programming more than anything right now, and he's pretty darn good at it for an elementary kid his age. He figured out how to make a menu page that links to separate scenes all on his own. He even made 'you win this level' and 'you lose this level' without any help from myself or his dad. RThurman, that's awesome that your son has a master's thesis in Programming. I agree that the right amount of fostering from a distance can be really good for a kid this age. Ace, thanks again for sharing your template. He's going to be thrilled to see it and work with it when he gets home.
Ace