Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,084 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,548 people online right now. Registration is fast and FREE... Join Now!




Make character sprites walk on level map (background)

 
Reply to this topicStart new topic

Make character sprites walk on level map (background)

skater_00
30 Apr, 2008 - 09:49 AM
Post #1

D.I.C Head
Group Icon

Joined: 30 Apr, 2008
Posts: 173



Thanked: 4 times
Dream Kudos: 50
My Contributions
For our C++ project at school, we have to create the first level of an existing arcade game that has a MAME rom available. I picked Sonic The Hedgehog 2, but that is actually unnecessary information in this case.

Right at this moment, I am encountering a first serious problem: you have character sprites (Sonic) and you have the level map as "background". How can you make your character walk, run, jump, walk against walls, fall in holes, etc. ON that level map as if he is actually really walking ON it.

I have Googled all over the place but I have no idea how to start or how to do this in general. I would not even know the name of the principle of making your character sprites walk on the "background" (level map).

Giving me a head start would be greatly appreciated.

Thanks in advance!

Note: Making the character sprite walk, run, jump, etc. is NOT my problem. Read my post again if you have misunderstood anything.

This post has been edited by skater_00: 30 Apr, 2008 - 10:06 AM
User is offlineProfile CardPM
+Quote Post

.Maleficus.
RE: Make Character Sprites Walk On Level Map (background)
30 Apr, 2008 - 05:35 PM
Post #2

D.I.C Head
**

Joined: 7 Mar, 2008
Posts: 126



Thanked: 2 times
My Contributions
This ought to give you a start, or at least an idea of the approach you need to take.

http://www.gamedev.net/reference/articles/article735.asp
User is offlineProfile CardPM
+Quote Post

KYA
RE: Make Character Sprites Walk On Level Map (background)
30 Apr, 2008 - 11:04 PM
Post #3

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 4,788



Thanked: 91 times
Dream Kudos: 1200
My Contributions
Sprites also have a Z-Order, in the case of sonic, the ramps, spikes, and circle things you roll around in are most likely sprites instead of the bitmap background so you can have collision detection and "pass" in front or behind "objects".
User is online!Profile CardPM
+Quote Post

skater_00
RE: Make Character Sprites Walk On Level Map (background)
6 May, 2008 - 08:09 AM
Post #4

D.I.C Head
Group Icon

Joined: 30 Apr, 2008
Posts: 173



Thanked: 4 times
Dream Kudos: 50
My Contributions
QUOTE(.Maleficus. @ 1 May, 2008 - 03:35 AM) *

This ought to give you a start, or at least an idea of the approach you need to take.

http://www.gamedev.net/reference/articles/article735.asp


After trying to figure this out for a few more days, it is still not very clear to me. So actually it is all about collision detection? Does that mean I would have to create hitregions for every possible piece of ground on the map that the sprite can run on?
User is offlineProfile CardPM
+Quote Post

bobjob
RE: Make Character Sprites Walk On Level Map (background)
6 May, 2008 - 09:47 AM
Post #5

D.I.C Head
**

Joined: 29 Mar, 2008
Posts: 62



Thanked: 1 times
My Contributions
You will defently need some sort of collision information. for a 2D platformer, i personally think, Point to line equation is best.
so you can have a character walking up diagnal walls. also really neet with gravity physics, slipping down diagnals and such.

if your in a rush to get a game finished, just go with basic point to box collisions. character will prob need to jump /drop to go up/down a level though.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:03PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month