Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

snake like game

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
newbob
Guest






PostPosted: Fri Apr 02, 2010 2:03 pm    Post subject: snake like game Reply with quote

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 Razz !
Back to top
newbob
Guest






PostPosted: Sat Apr 03, 2010 11:30 am    Post subject: Reply with quote

btw I've already tried the idea above and it didn't work. Crying
Back to top
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sat Apr 03, 2010 5:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
newbob
Guest






PostPosted: Sun Apr 04, 2010 9:33 am    Post subject: Reply with quote

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
Halloween 2006 Creativity Winner



Joined: 26 May 2005
Posts: 335

PostPosted: Sun Apr 04, 2010 10:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sun Apr 04, 2010 1:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Rimudora
Psychopath yandere
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 26 May 2005
Posts: 335

PostPosted: Sun Apr 04, 2010 2:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Guest







PostPosted: Sun Apr 04, 2010 6:02 pm    Post subject: Reply with quote

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! Happy Happy
Back to top
Guest







PostPosted: Sun Apr 04, 2010 6:32 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group