Well, I'm going to start creating a game, but there are questions which need to be answered. I'm new to the boards, but not to MegaZeux. I use 2.81h, and am an okay programmer.
First Question:
If I want to have an enemy that can be injured, how can I make that into a subroutine, so it won't restart an attack program?
Furthermore, does anyone have any good programs for enemies?
Page 1 of 1
New Game
#1
Posted 07 February 2008 - 02:30 AM
Teacher -"Can you tell me anything about the solar system, Billy?
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
#2
Posted 07 February 2008 - 03:03 AM
You can use subroutines, as long as you use a custom player weapon instead of default bullets.
: "justentered"
set "local" to "enemies"
inc "enemies" by 1
set "enemy&local&_hitpoints" to 3
goto "main"
[...]
: "#shot"
dec "enemy&local&_hitpoints" by 1
if "enemy&local&_hitpoints" > 0 then "#return"
goto "eleminated"
If that seems too complicated to you, you can use "local" as your hit points counter and use:
: "#shot"
dec "local" by 1
if "local" > 0 then "#return"
explode 0
: "justentered"
set "local" to "enemies"
inc "enemies" by 1
set "enemy&local&_hitpoints" to 3
goto "main"
[...]
: "#shot"
dec "enemy&local&_hitpoints" by 1
if "enemy&local&_hitpoints" > 0 then "#return"
goto "eleminated"
If that seems too complicated to you, you can use "local" as your hit points counter and use:
: "#shot"
dec "local" by 1
if "local" > 0 then "#return"
explode 0
#3
Posted 07 February 2008 - 03:06 AM
Excellent! Thank you very much. Could you explain how to create a custom weapon? I haven't explored that area of programming.
Teacher -"Can you tell me anything about the solar system, Billy?
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
#4
Posted 08 February 2008 - 12:50 AM
I figured out how to make a custom weapon, and created a sword program, but I'm not quite sure how to make it a subroutine.
Teacher -"Can you tell me anything about the solar system, Billy?
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
#5
Posted 08 February 2008 - 04:30 AM
I figured out the subroutine, and am ready to start my game!
Teacher -"Can you tell me anything about the solar system, Billy?
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Can you tell me anything about the other planets?"
Billy - "THE BIG YELLOW ONE IN THE MIDDLE IS THE SUN!
Teacher - "Calm down, Billy."
Billy - "THE BIG... YELLOW... ONE IN THE MIDDLE... IT'S THE SUN!"
Share this topic:
Page 1 of 1

Help






