Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Simple Space Invaders [Help Desperately Needed]
Old
SarabScientist
Junior Member
 
Status: Offline
Posts: 8
Join Date: Nov 2012
Question Simple Space Invaders [Help Desperately Needed] - 11-08-2012, 10:29 AM

First off, I admit, I'm probably the biggest Alice noob that you'll meet. Now that you've probably placed me in the general category of "typical computer-challenged" person, lets get to my problem.

I am trying to make a simple version of the Space Invaders game. All I need is for the "aliens" to shoot randomly. And the "ship" to be able to move side to side and when the space bar is pressed, to shoot the incoming aliens. Of course, once the target is shot, it must disappear. In addition, I need a timer (10 seconds) and a score counter (every enemy shot: one more point).

I've barely completed a simplistic version of a "Wack-A-Mole"
game and to be quite honest, I'm surprised I didn't go bald from pulling all my hair out.

I know how to do the basics though (events, methods, parameters, etc ...)

Step-by-step directions on how to complete this Space Invaders game is highly appreciated!!! And thank you in advance

Last edited by SarabScientist; 11-08-2012 at 10:38 AM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-08-2012, 04:17 PM

That's a taller order than you probably realize.

I'll try to break it up into small parts.

1. Start with a new world

2. Delete the ground object

3. Add a cone shape to the world, then position it at the bottom of the screen

4. Orient the cone to the camera. (Right click it, then select methods, then select orient to, then select camera)

5. Click the "create new event" button and select "when a key is typed"

6. Repeat step 5 twice.

7. Right click each of the three new events and select "change to" then select "while a key is pressed" for all three of them

8. Change the top event's key from "any key" to "left"

9. Change the next event's key to "right"

10. Change the final event's key to "up"

11. Add a "cone move left" method to the during part of the event. Change the distance moved to .05 meters and the duration to 0 seconds. It should look like this:



12. Do the same thing for the next event, but change the direction to "right"

If you're with me so far, post a world file with this work done, and we'll continue from there.


(')>
   
Reply With Quote
Old
SarabScientist
Junior Member
 
Status: Offline
Posts: 8
Join Date: Nov 2012
Default 11-08-2012, 06:25 PM

Actually, I did some messing around, and uh here is what I have (without your orders).

So, what I have left to do is to actually make the time counter work and add in a counter for the score. And make the enemies shoot randomly, disappear when shot at. And make the game end after the time has run out/your ship has been shot at three times.

Thanks a lot, really, I would probably have died trying to make this work.
Attached Files
File Type: a2w SpaceInvadersGoodCopy.a2w (1.28 MB, 17 views)


Help needed with a simple game of Space Invaders >>> http://www.alice.org/community/showthread.php?p=51510#post51510

Last edited by SarabScientist; 11-08-2012 at 06:33 PM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-08-2012, 07:01 PM

I just realized my earlier post sounds incredibly condescending.

Sorry about that. Not my intention at all, really.

I'd actually just tried to make a video of me making a space invader world, to make it easy to watch and do yourself, but the process (and the video) ended up taking way too long. I knew a giant video like that would make an equally giant wall of text, hence my falling back to plan B: breaking it up into small parts.

Anyway.

You should add the event motion I described in my earlier post, that way you can hold a key for continuous, smooth motion, like a real video game.

You should also make the bullet turn invisible and move back to the ship in zero seconds when it's done moving forward.

You should also make the bullet's vehicle change to "the entire world" after it is fired, then back to the ship when it returns, to avoid implausible bullet paths.

Here, go ahead and take a look at the world I made as an example for the video. The motion and shooting mechanics are solid, but the enemy motion and score counters haven't been implemented.

I'll make a separate example of counters and enemy motion later, but if you want, you can search for example worlds on the forums. There are tons to choose from.
Attached Files
File Type: a2w space invaders.a2w (82.3 KB, 19 views)


(')>
   
Reply With Quote
Old
SarabScientist
Junior Member
 
Status: Offline
Posts: 8
Join Date: Nov 2012
Default 11-09-2012, 09:55 AM

Oh no, it was not condescending at all! Or it might just be me, because I'm used to being yelled at for screwing up frequently xD

I will check out your uploaded file when I have access to my computer. If the shooting mechanics are solid and stuff, I will probably end up using your file as a base and implementing the timer and score counter under your instructions. Thanks a bunch, again.

Might as well follow your model as I think it will be easier for you to guide me. Here is the basic movement functions of the cone shooter. If it isn't too much of a hassle, you can continue listing your instructions as you did before, they're easy to follow and I believe it would be easier
Attached Files
File Type: a2w SpaceInvadersSarabScientist.a2w (26.8 KB, 9 views)


Help needed with a simple game of Space Invaders >>> http://www.alice.org/community/showthread.php?p=51510#post51510

Last edited by SarabScientist; 11-26-2012 at 07:45 PM. Reason: Added the .a2w file
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-09-2012, 02:08 PM

The base model is the world I posted. It has functional shooting, bullet collision, and motion. All you need to do is add enemy motion (which you've already shown me that you can do) and the counters (a score counter is just a time counter with variable that increments when something good happens instead of every second).

The enemy shooting might be a bit difficult, though. I'll throw another example together. The attached world has the beginnings of an enemy shooting mechanic. If you have questions (and you should), take a look at it and let me know what you need to know.

The instructions I might be able to continue, but it looks like you're having a hard time following them. The cone shooter world you posted still has that jerky motion I was telling you to avoid.

And if I help you over the weekend, it'd have to be before 4:30 PM EST. I have to go to work after that.
Attached Files
File Type: a2w space invaders2.a2w (69.0 KB, 19 views)


(')>

Last edited by x2495iiii; 11-09-2012 at 03:08 PM.
   
Reply With Quote
Old
SarabScientist
Junior Member
 
Status: Offline
Posts: 8
Join Date: Nov 2012
Default 11-09-2012, 06:26 PM

I do not need as much of a complicated/well executed program as the one you have attached. After all, I am just an amateur! The jerky movements and such things are fine in my case, and actually I think it looks better. I'm probably getting on your nerves, aha, but please bear with me. I've decided I can give up on the random enemy shooting, and just stick with the regular shooting.


Help needed with a simple game of Space Invaders >>> http://www.alice.org/community/showthread.php?p=51510#post51510

Last edited by SarabScientist; 11-26-2012 at 07:46 PM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-10-2012, 12:40 AM

The first example world I posted has the enemy disappear thing already done.

And really, a complicated world is just a world made of several simple parts. I was planning to break down the simple parts to make them easy to understand.

For example, the enemyStep variable. This is just a number that goes from 0 to 3 then back to 0 repeatedly.

Its purpose is to keep track of what action the enemy is to take next. At the moment, this is useless, but after adding enemy death code to the world, that single variable can make the actual endgame happen faster, avoid extra animations after the enemy is dead, and even allow for random or custom enemy motion patterns, if you decide to make smarter or faster enemies.

As for the score counter, again, if you know how to make a visible timer, you know how to make a score counter.

You know how to add a number variable to the world. Add one named "score". You know how to increment that variable. Make it increment when an enemy disappears. You know how to make 3d text that changes to match a number variable. Add some 3d text and make it change its text to "score as a string" whenever the score variable changes value.

You're not getting on my nerves, you just don't seem to want to do all the best parts of the game, even when they're spelled out for you.


(')>
   
Reply With Quote
Old
SarabScientist
Junior Member
 
Status: Offline
Posts: 8
Join Date: Nov 2012
Default 11-10-2012, 03:46 PM

The enemies will disappear when they are shot?

Ah.

I'm sorry ... I'll just put it this way ... could you do this for me? I'm currently neck-deep in tasks and this is just a bit low on the priority list.


Help needed with a simple game of Space Invaders >>> http://www.alice.org/community/showthread.php?p=51510#post51510

Last edited by SarabScientist; 11-26-2012 at 07:46 PM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-10-2012, 03:50 PM

I can't.

Letting you submit my work as your homework would be plagiarism, and we don't do that here.

I can answer questions and write examples, but I can't just make the world for you.

Besides, you're so close to getting it. I think you can do it just fine.


(')>
   
Reply With Quote
Reply

Tags
basics, space invaders

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.