Pages: 1
Topic closed
I am making a game in where you are a spaceship, and you shoot enemies. But, I don't know how you make it so you shoot a lazer or anything at all. Please Help!!!!!!!!! :-(
Offline
THANKS ROCKIE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Offline
For shooting a laser, you can just change costumes to one that has the laser beam turned on.
You can use "color touching color" to see if the laser beam is touching a sprite.
Offline
Also, how do you make more than one level? I never figured that out.
Offline
Instead of making the background your level, you draw your level by hand as a sprite and draw all other levels after that as costumes for that sprite.. Then when your character hits the end of a level, you can say switch to costume 2 or something and it will switch to another level that you drew.
For instance: When I recieve Area 2>switch to costume 2.
Offline
The background can actually have costumes (just like sprites), so you can just change the background. One easy way to do this is to watch the "x position" of your player sprite. If the sprite gets near the right edge, you can switch the background costume and send the sprite to the other edge of the screen. (It will walk off the right edge, then enter a new scene from the left side.)
In the Sprite:
If "x position" > 238
set x to ("x position" * -.95)
Broadcast "NextBackground"
In the Background:
If I receive "NextBackground"
next costume
You could go the other way by monitoring for x < -238 and broadcasting a message to the background to tell it to go to the previous costume. Of course, you'll need to check to see that there is a next (or previous) background to "jump" to.
-MrEd
Offline
The laser help was great for me, but I want to do something slightly more complicated: I have a character standing on the ground, and I want the bullet to appear at his front and then move in the direction that the cursor was pointing when it was clicked. How do I do that without having the bullet follow the mouse?
Offline
Hi ILikeFood,
you could let the bullet glide to the location of the mouse pointer.
In your bullet-sprite you could try scripting something like this:
[blocks]
<when green flag clicked>
<hide>
<forever if><mouse down?>
<go to x <{ startX }> )y <{ startY }>
<show>
<glide( 0.2 )secs to x <mouse x> )y <mouse y>
<hide>
<end>
[/blocks]
This script will make the sprite glide towards the position of the mouse at time it was clicked. Moving the mouse afterwards will not affect the movement's destination. To make the sprite go faster you could experiment with different values in the glide-block. For example, if you want the bullet to move at the same speed regardless of how far it has to go, you could replace the number in the glide block by the following expression:
[blocks]
(( 0.002 <*> <distance to[ mouse pointer ))
[/blocks]
Did that help?
Offline
Topic closed
Pages: 1