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

Bomberman Style game

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bomberman9000
You are the n00b




Joined: 21 Mar 2003
Posts: 3
Location: New Zealand

PostPosted: Thu Sep 25, 2003 3:46 am    Post subject: Bomberman Style game Reply with quote

Hi people.

I've been working on a bomberman style game for a while but I can' t get the script to work. When i plant a bomb, the bomb explodes like it should but the explosion appears in the top left corner. I'll put the script here.

Quote:
#---------------------------------------------------------------

Include, bomberman.hsi
Include, Scancode.hsi
Include, Plotscr.hsd

#---------------------------------------------------------------
#Scripts

Define Script (1,bombing,none)

#---------------------------------------------------------------

Script, Bombing, begin
If (key is pressed(key:m))
Then (Begin)
Variable (Bomb)
Bomb:=NPC Reference(0) #NPC reference for the bomb.
X:= NPC X (bomb)
Y:= NPC Y (bomb)
Variable (X)
Variable (Y)
Create NPC (Bomb, Hero X, Hero Y, Down) #Place the bomb
set NPC direction (Bomb,down)
wait (10)
set NPC direction (Bomb,left)
wait (10)
set NPC direction (Bomb,up)
wait (10)
set NPC direction (Bomb,right)
wait (10)
destroy NPC (Bomb)
wait (1)
Create NPC (1,X + 1, Y, down) #Bomb Explodes
Create NPC (1,X -- 1, Y, down)
Create NPC (1,X, Y + 1, down)
Create NPC (1,X, Y -- 1, down)
wait (1)
Create NPC (1,X + 2, Y, down)
Create NPC (1,X -- 2, Y, down)
Create NPC (1,X, Y + 2, down)
Create NPC (1,X, Y -- 2, down)
wait (1)
Create NPC (1,X + 3, Y, down)
Create NPC (1,X -- 3, Y, down)
Create NPC (1,X, Y + 3, down)
Create NPC (1,X, Y -- 3, down)
wait (3)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
)
end
end
#---------------------------------------------------------------


Can anyone see where i went wrong?
_________________
Simon James
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Minnek
Conjurer




Joined: 03 Jun 2003
Posts: 430
Location: Somewhere

PostPosted: Thu Sep 25, 2003 4:45 am    Post subject: Reply with quote

I think I've got this one. You're assigning your X and Y variables before you have placed the bomb in the right location. Also, you may want to declare the variables THEN do the assignments.

Quote:

#---------------------------------------------------------------

Include, bomberman.hsi
Include, Scancode.hsi
Include, Plotscr.hsd

#---------------------------------------------------------------
#Scripts

Define Script (1,bombing,none)

#---------------------------------------------------------------

Script, Bombing, begin
If (key is pressed(key:m))
Then (Begin)
Variable (Bomb)
Bomb:=NPC Reference(0) #NPC reference for the bomb.
Variable (X)
Variable (Y)
Create NPC (Bomb, Hero X, Hero Y, Down) #Place the bomb
Wait (1) # Just in case
X:= NPC X (bomb) # I moved the two variable assignments down here.
Y:= NPC Y (bomb)
set NPC direction (Bomb,down)
wait (10)
set NPC direction (Bomb,left)
wait (10)
set NPC direction (Bomb,up)
wait (10)
set NPC direction (Bomb,right)
wait (10)
destroy NPC (Bomb)
wait (1)
Create NPC (1,X + 1, Y, down) #Bomb Explodes
Create NPC (1,X -- 1, Y, down)
Create NPC (1,X, Y + 1, down)
Create NPC (1,X, Y -- 1, down)
wait (1)
Create NPC (1,X + 2, Y, down)
Create NPC (1,X -- 2, Y, down)
Create NPC (1,X, Y + 2, down)
Create NPC (1,X, Y -- 2, down)
wait (1)
Create NPC (1,X + 3, Y, down)
Create NPC (1,X -- 3, Y, down)
Create NPC (1,X, Y + 3, down)
Create NPC (1,X, Y -- 3, down)
wait (3)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
destroy NPC (1)
)
end
end
#---------------------------------------------------------------


This should work. (I added some comments in there so you could see what I was doing, if it wasn't already apparent.) Let me know if it does or doesn't and I'll try to help some more if possible Oookay...
_________________
* SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Bomberman9000
You are the n00b




Joined: 21 Mar 2003
Posts: 3
Location: New Zealand

PostPosted: Fri Sep 26, 2003 3:55 am    Post subject: Reply with quote

Thanks man, you're the legend
_________________
Simon James
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Mon Sep 29, 2003 10:28 am    Post subject: Reply with quote

just saying this as a comment, that's a lot of destroy NPCs
_________________
If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Minnek
Conjurer




Joined: 03 Jun 2003
Posts: 430
Location: Somewhere

PostPosted: Mon Sep 29, 2003 9:16 pm    Post subject: Reply with quote

I like destroying NPCS Big grin
_________________
* SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Setu_Firestorm
Music Composer




Joined: 26 Mar 2003
Posts: 2566
Location: Holiday. FL

PostPosted: Mon Sep 29, 2003 10:50 pm    Post subject: Reply with quote

Yeah, but you only need destroy an NPC once. Otherwise, you're compiling a lot of unnecessary lines.
_________________


Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
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