Be a Supporter!

Help with a game??

  • 574 Views
  • 21 Replies
New Topic Respond to this Topic
Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Help with a game?? 2005-10-08 11:37:07 Reply

I tried the lets make an RPG thread and it didnt have what i wanted...

I need an AS for a wall so that the character cant go through it.

would really appreciate the help.

Zielak
Zielak
  • Member since: Sep. 21, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to Help with a game?? 2005-10-08 11:51:42 Reply

here you are [=RPG ENGINE=].fla

Devenger
Devenger
  • Member since: Dec. 24, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Help with a game?? 2005-10-08 12:08:50 Reply

Never throw an .fla at a newbie!

Try AS: Basic Movement. That's in AS: Main


I'm back! on a temporary basis. No-one can remember who I am! but I don't really mind.

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 12:15:32 Reply

thanx just gotta add an altered version of the code to my game...

cheers

4Doctodragon
4Doctodragon
  • Member since: Feb. 5, 2005
  • Offline.
Forum Stats
Member
Level 31
Blank Slate
Response to Help with a game?? 2005-10-08 12:19:05 Reply

wait... your calling him a noob, yet you havent realy done much in flash... *gasp* (suspence)


BBS Signature
Devenger
Devenger
  • Member since: Dec. 24, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Help with a game?? 2005-10-08 12:26:05 Reply

Me? I just never get down to do any work, I suppose. I do know stuff, but I have something called school and homework, and spend the rest of the time browsing and stuff. :X


I'm back! on a temporary basis. No-one can remember who I am! but I don't really mind.

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 12:28:37 Reply

that didnt exactly help because i only want to make it so the player cant go through a wall and i couldnt see that in the link...thanx anyway and if you could post some AS that would help i would be grateful.

i already know all the motion/hit test script. how to make stuff move etc...

i'm not really a newbie btw :)

Devenger
Devenger
  • Member since: Dec. 24, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Help with a game?? 2005-10-08 12:30:07 Reply

Well, it's all about adapting the hitTest code, isn't it?


I'm back! on a temporary basis. No-one can remember who I am! but I don't really mind.

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 12:31:41 Reply

i think so i just cant get my head round it....

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help with a game?? 2005-10-08 12:33:20 Reply

At 10/8/05 12:28 PM, Matchubox wrote: that didnt exactly help because i only want to make it so the player cant go through a wall and i couldnt see that in the link...thanx anyway and if you could post some AS that would help i would be grateful.

Here ya go =D
...

onClipEvent (enterFrame) { if (this.hitTest(_root.INSTANCE NAME HERE)) { _x = _x+5; } }

Put this on the one that moves. Change the instance name to w/e you called the wall. That code was to stop them walking off the screen while walking left, to stop them walking off the screen while walking right use this code...

onClipEvent (enterFrame) { if (this.hitTest(_root.INSTANCE NAME HERE)) { _x = _x-5; } }

Tell me if you need any more help on this!

Thanks,

Sam

Devenger
Devenger
  • Member since: Dec. 24, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Help with a game?? 2005-10-08 12:36:51 Reply

Saza, with that code you will end up needing to add a lot of horrible, unoptimized code, because you need to hitTest against every single wall ...

... if you wan't that method, put the hitTesting on the walls.


I'm back! on a temporary basis. No-one can remember who I am! but I don't really mind.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help with a game?? 2005-10-08 12:39:19 Reply

Hmm yeah, I guess that would be alot easier ^^;;
Still, im not that good at flash. xD

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 12:41:48 Reply

sorry but this doesnt work, i've looked at other flash and you need to put code into the wall and i know how to make it so that you cant go off the screen and thats fine.

but yea thanx :S any more help would be most excellent

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help with a game?? 2005-10-08 12:46:39 Reply

btw they were only for the left and right walls, did you change the code, where it said INSTANCE NAME to the walls instance name?

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 12:48:59 Reply

yea i did :s it just dint seem to do anything...

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help with a game?? 2005-10-08 12:52:07 Reply

awww well lol

Paranoia
Paranoia
  • Member since: Apr. 22, 2005
  • Offline.
Forum Stats
Member
Level 35
Game Developer
Response to Help with a game?? 2005-10-08 12:55:39 Reply

At 10/8/05 12:26 PM, TheDeviousDuck wrote: Me? I just never get down to do any work, I suppose. I do know stuff, but I have something called school and homework, and spend the rest of the time browsing and stuff. :X

I find it's much more efficient to set yourself deadlines for your flashes!

I've yet to encounter a piece of school work which can't be delayed without consequence for at least a week


BBS Signature
Cojones893
Cojones893
  • Member since: Mar. 9, 2003
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Help with a game?? 2005-10-08 12:59:30 Reply

Code for character

onClipEvent (load) {
lastx = 0;
lasty = 0;
}
onClipEvent (enterFrame) {
lastx = _x;
lasty = _y;
if (Key.isDown(Key.RIGHT)) {
_x += 2;
} else if (Key.isDown(Key.UP)) {
_y -= 2;
} else if (Key.isDow(Key.DOWN)) {
_y += 2;
} else if (Key.isDown(Key.LEFT)) {
_x -= 2;
}
// end if
}

CODE FOR WALL

onClipEvent(enterFrame){
if(hitTest(_root.CHARACTERNAME)){ //Change CHARACTERNAME to your players instance name
_root.playa._x=_root.playa.lastx
_root.playa._y=_root.playa.lasty
}
}

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 13:13:38 Reply

sorry it didnt work :( this sucks cos nothing seems to do what i want would it have anything to do with flash 8 pro??? cos i had to change all my hitTests before so they worked on flash 8.....

caseyo
caseyo
  • Member since: May. 14, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to Help with a game?? 2005-10-08 13:17:18 Reply

AS: Movement - Basic
AS: Collisions by Glaiel_Gamer
AS: Collision Detection by BleeBlap

I rest my case...

Matchubox
Matchubox
  • Member since: Feb. 16, 2005
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Help with a game?? 2005-10-08 13:17:56 Reply

At 10/8/05 01:13 PM, Matchubox wrote: sorry it didnt work :( this sucks cos nothing seems to do what i want would it have anything to do with flash 8 pro??? cos i had to change all my hitTests before so they worked on flash 8.....

well it sort of works thanx dude ill just addapt it to see if can make it work properly.

thanx a lot.. :)

Cojones893
Cojones893
  • Member since: Mar. 9, 2003
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Help with a game?? 2005-10-08 15:09:21 Reply

what doesn't work about it. You can't just say "it doesn't work" that could mean anything. Does he hit the wall? Does he walk through it? Does he walk through it then get stuck?