skip navigation
Game Plague Forums
Not a member? ( Register )
User Name: Password:
Item question - Showing Replies by Iasper
Pages: [1] -
Pazaza
10/20/12 06:52 pmFilter

Dualer


Awards:

Group: Member
Posts: 210
How would one program an item while while you were using it. Enemies passed right through you and you passed through enemies. But you couldn't pass through walls. All this in a Zelda like game?

------------
WHAAAAA....!!???!
Showing Replies by Iasper - Return to Full Replies
Iasper
10/20/12 07:50 pmFilter - Reply #1

Dual Master


Awards:

Group: Member
Posts: 1099
...your post is awfully vague and not understandable. Could you try rewriting your question and going a bit more into detail?

------------
Iasper
10/21/12 06:14 amFilter - Reply #2

Group: Member
Well, first of all set a variable to see if the item is in use or not, then check the variable when you check collision with enemies.
Iasper
10/22/12 10:15 pmFilter - Reply #3

Group: Member
So for example add in the code for the collision event with walls for the player following code: x=xprevious; y=yprevious; This will prevent the player from moving into walls. For moving objects such as enemies a more complicated code is required but let's assume enemies don't move either, give them following code: if (global.itemused==false) { x=xprevious; y=yprevious: } This will make you bump into enemies as well if global.itemused is false. Whenever you want to activate the item, set global.itemused to 1.
Iasper
10/24/12 12:47 pmFilter - Reply #4

Group: Member
When global.itemused equals 1, you can freely pass through enemies but not through walls.
Pages: [1] -