Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / I have my background working but....

Author
Message
Ads
20
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 20th Sep 2003 22:22
The backgrounds on and working but when my sprites move they are slower. How do I stop them from being slow?. P.s I use texture backdrop for background.
Jimi
20
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 20th Sep 2003 23:48
are you using sync?

Ads
20
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 21st Sep 2003 01:12
yeah
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Sep 2003 02:49
Use the SET SPRITE command to switch of the backsave feature. You don't need it because the background is being redrawn automatically every frame by the textured backdrop.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Sep 2003 15:46
Adding a backdrop will slow your game down, just move your sprites around with higher values to compensate. It's tricky, but perhaps you need a time elapse system so that the speed is constant. Basically every sync you'd check the elapsed time in miliseconds, then multiply all your movement speeds by that, Wolf posted code for this some time ago. It also means that the game runs at the same virtual speed on any PC, a sprite moving along the screen will move at the same speed on any PC, but a faster PC would be smoother.


Van-B


Van-B

My cats breath smells of cat food.
Ads
20
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 22nd Sep 2003 20:15
You see games like mario and metroid well how would I make it so there are platforms to jump on and how would I make the game sidescroll and follow the character?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Sep 2003 15:34
Usually, the best way to add platforms is with a map array, say ever 16x16 pixel block on your level is refered to with a 2D array. You would use this to draw the level with Paste Image or something, then use it again for collision detection. In mario, the background could be a long image that is repeated, then you'd just have to draw the ground and any platforms on the screen at any 1 time. You could pre-draw the whole level, but that means really big bitmaps. There are lots of 2D engines that use this method, why not take a trip to www.underwaredesign.com and look through the code snippets.


Van-B

My cats breath smells of cat food.

Login to post a reply

Server time is: 2024-05-05 17:19:08
Your offset time is: 2024-05-05 17:19:08