View previous topic :: View next topic |
Author |
Message |
newbob Guest
|
Posted: Fri Apr 02, 2010 2:03 pm Post subject: snake like game |
|
|
Greetings, I'm new here but not so new to the ohrpgce, i've coming and going reading the forum along the years, still I'd say i'm a pretty bad plotscripter, so could anybody give a hand on this?
I'm trying to make a game like the one where you control a snake-worm thing that eats something and it starts growing a tail, if you keep eating your tail keeps on growing and if you happen to bump into her you die, my idea so far goes like this: first when you eat the item it creates a npc where the hero is located this npc is set to follow you and is activades by touch, this new npc when touched run another script that sets his speed to zero, then there is another script specifically a on key press script that make that when you push any direction it sets the npc speed up again so it follows you, it might work but I haven't tried this yet because I believe that your tail is long enough and there is shorter way to get to you the last npc on line (the line your tail) will break out and screw everything up, so any ideas to acomplish this?
thanks is sort of exciting to post here for the first time yay ! |
|
Back to top |
|
 |
newbob Guest
|
Posted: Sat Apr 03, 2010 11:30 am Post subject: |
|
|
btw I've already tried the idea above and it didn't work.  |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sat Apr 03, 2010 5:09 pm Post subject: |
|
|
Hi bub,
Post your source code, so that others don't have to guess what you did :-)
Then hopefully you can get the help that you need. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
newbob Guest
|
Posted: Sun Apr 04, 2010 9:33 am Post subject: |
|
|
well I'll post this but I don't think this sould have been they way to do this in the first place, well, as I already stated I'm a lame plotscripter
3 scripts working here: come, stop, cola
define script(1, come, none)
define script(2, stop, none)
define script(3, cola, none)
This one runs when you step on on the item that you supossedly eat:
script, come, begin
(create npc(0, herox(me), heroy(me))
end
end
This one when the just created npc touches you:
script, stop, begin
set npc speed (0,0)
end
This to make the just created npc follow you
plotscript, cola, begin
if(hero is walking(me) == true) then(
set npc speed (0, 20)
if(hero is walking(me) == false) then(
set npc speed (0, 0)
)
)
end
I think there might be a better way to achieve what I'm trying to do. |
|
Back to top |
|
 |
Rimudora Psychopath yandere Halloween 2006 Creativity Winner


Joined: 26 May 2005 Posts: 335
|
Posted: Sun Apr 04, 2010 10:46 am Post subject: |
|
|
You probably shouldn't rely on "NPC chases hero" to make the pieces of the snake's tail follow its head. If you've played games like Purgatory, you know that there's some randomness involved and the NPCs won't follow the hero perfectly. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun Apr 04, 2010 1:02 pm Post subject: |
|
|
I think this kind of game would work better using slices.
This kind of script would be a lot more complicated, of course.
Each slice comes with three "extra data" slots. Each slice uses one of the slots to store the ID# of the one it's supposed to follow. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Rimudora Psychopath yandere Halloween 2006 Creativity Winner


Joined: 26 May 2005 Posts: 335
|
Posted: Sun Apr 04, 2010 2:07 pm Post subject: |
|
|
I think slices would make it even more complicated than it needs to be.
Anyways, here. I tried writing a script for a snake game that uses only maptiles. I included the source code so you can get some idea how things work.
http://www.castleparadox.com/gamelist-display.php?game=1002 |
|
Back to top |
|
 |
Guest
|
Posted: Sun Apr 04, 2010 6:02 pm Post subject: |
|
|
I've downloaded the file and it's great just like I wanted thank you for going for all that trouble, I really don't understand the source code but will study it a lot cause there are a few things I'd like to change, anyway if I got any doubt you'll be hearing from me again thanks!  |
|
Back to top |
|
 |
Guest
|
Posted: Sun Apr 04, 2010 6:32 pm Post subject: |
|
|
well, I posted before checking it out completely, my idea was to have a more elaborated snake game something with diferent maps and some puzzle action, but this code messes with maptiles so it's not quite what I'd need. Thanks anyway |
|
Back to top |
|
 |
|