Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-18-2007, 12:48 PM   #1
messhof
Registered User
 
Join Date: Mar 2007
Posts: 5
Default [AS2] Scrolling gameworld

Hey, I'm just getting into making games in flash. I want to make a game in which you walk around a large area filled with walls, items, and enemies. All the tutorials I've seen so far have everything BUT the player move. Do any games have the player move and the view move with him? How is this done? Also, do people generally make one image be all the walls int he level, or is tiling with a bunch of objects more common? Thanks.
messhof is offline   Reply With Quote
Old 03-18-2007, 04:36 PM   #2
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

hey and welcome to the site. A member just posted a similar question and I made a little demo file for him. I don't know if it helped him cause the ingrate....errr, I mean upstanding member never wrote back. Anyway, check this out:

http://creativenetdesign.com/actionScript/mover/

if you scroll to the left and hit the very edge you will see the background starts to move. It was only a demo so I didn't program the functionality for the top, right and bottom. Also, if you notice, when you move in any direction the character knows and thus can react. If you are interested I can give you the source files and explain it to you.

Dvl

Last edited by dvlnblk; 03-18-2007 at 04:36 PM. Reason: Cause I cannot spell
dvlnblk is offline   Reply With Quote
Old 03-18-2007, 04:49 PM   #3
messhof
Registered User
 
Join Date: Mar 2007
Posts: 5
Default

Yeah, this is what I'm talking about. Looking at the source would be really helpful, thanks. I just realized that maybe all 2d games have everything but the player move after he gets to the edge of the view, since the "view" doesn't really exist.. Sorry, I was raised on gamemaker!

Also, what's a good fps/screen size for playing the game through a browser? I have mine as a 640x480 at 60fps which runs great offline, but through firefox it's kinda sluggish. http://messhof.com/boolflash.html

Maybe it's also because the walls are one image? (drawn in flash, not bitmap)
messhof is offline   Reply With Quote
Old 03-18-2007, 06:58 PM   #4
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

Sure, it is now attached. And, yeah, maybe try and make the background a bitmap. I think it will add to the preload time but it will lower the CPU procesing. The way I understand it is that Flash re-draws a vector everytime it moves. Conversly (< typo for sure) it caches a bitmap and then can move it around without having to do the math to redraw it. I could be wrong though, so I would try a bitmap and see if it increases performance.

As for my example, I make the character move and in his move function I put a conditional that says "if character's x is a the very left then stop him from moving and make the background move"

Basically that is it. You will have to add this functionality for up down and right and also add functionality that says if map is at the end ( you cannot have a background that is infinate) then dont move it anymore.

Get it?
Attached Files
File Type: zip game.zip (10.5 KB, 168 views)
dvlnblk is offline   Reply With Quote
Old 03-18-2007, 07:03 PM   #5
jsonchiu
Senior Member
 
Join Date: Aug 2006
Posts: 481
Default

or change the cacheAsBitmap property to true.
__________________

My Personal Website
jsonchiu is offline   Reply With Quote
Old 04-29-2007, 01:01 PM   #6
messhof
Registered User
 
Join Date: Mar 2007
Posts: 5
Default

I'm having trouble with the cacheAsBitmap. How do I implement this?
messhof is offline   Reply With Quote
Old 12-05-2009, 03:07 PM   #7
Digitknight
Registered User
 
Join Date: Dec 2009
Posts: 8
Default

I think your looking for the same I am where its more Super Mario World where the level moves when the character reaches a certain point.
Digitknight is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
share your OOP+XML scrolling window ideas kensuguro ActionScript 2.0 1 08-06-2006 01:59 PM
simple scrolling help quovadimus02 ActionScript 1.0 (and below) 2 09-03-2005 09:26 PM
help with text scrolling darth Other Flash General Questions 0 09-03-2004 04:18 PM
scrolling line of images mairoLT ActionScript 2.0 8 12-11-2003 06:20 AM
scrolling lists generator object ? spoonyg Server-Side Scripting 0 01-04-2002 03:41 AM


All times are GMT. The time now is 12:32 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.