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.

Newcomers DBPro Corner / Sprite strangeness

Author
Message
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 23rd Dec 2003 09:55 Edited at: 23rd Dec 2003 09:58
Hmm...I've looking at the pretty much useless examples of sprites in the "Beginner's Guide to DarkBASIC Game Programming" book (wow...after using DBPro for a year and then buying the book, I really do see why it's the "Beginner's Guide"...had to skip the first 10 chapters or so before I hit stuff I'd never done before). They, of course, don't help me.

My current project is to make a sort of improved Castlevania remake with a bunch of neat little features that the first didn't have. However, right off the bat I found myself in some really bad problems, primarily with sprites.

Generally, in my past games, I've worked with 3D, so the "load image/paste image" combo worked just fine. Now, with this being my first foray into 2D with DBPro, I've been taking it step by step, doing various parts of the program in small, contained programs and then merging them into a whole.

Now, after making a little HUD program (I sat around and played with the life bars for a few hours...it was fun), I merged it into a new program that was supposed to feature a movable Simon Belmont (yes, everything is ripped from Super Castlevania 4, since I own it, except for the HUD, which is from Castlevania Bloodlines) who could attack and a button to hit him (playing the hit animation).

This is where my problems start. Obviously, I cannot grasp how to use sprites. It seems as though I'm using the commands incorrectly or something, because I can't even get the character sprite to display, along with other problems (once I had it to where I was retrieving parts of the HUD and making it move around, though even then the right movement wouldn't work...probably my fault there).

My program so far is located at http://unseenstudios.dbpcommunity.com/sprite.zip. It's about 1 MB.

Does anyone have the slightest idea what I'm doing wrong? That worthless book sure isn't helping me.

Edit - Realized a probable misinterpretation in my post. I said Simon was supposed to be able to do all of these things, but I was just trying to get a sprite of him to move without animation at this point. That is why I've only included the base frame in the zip file.

My friends' and my website for programming:
http://unseenstudios.dbpcommunity.com
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2003 13:01
There were only a few things that needed sorting out...

1 - you were mirroring the HUD, not Simon
2 - You were trying to increase/decrease an integer variable by 0.5
3 - You didn't set the current bitmap back to 0 after loading your bitmap, meaning that everything was being drawn to bitmap 2, instead of bitmap 0 (the display).

Here's the fixed code



For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 23rd Dec 2003 18:02 Edited at: 24th Dec 2003 05:28
Hmm...well, that seems to work 2000 times better than my horrible attempt at it, but there's still a problem: the level (er, I mean, the screenshot of SCV4) doesn't load now, and so Simon is walking around a blue screen.

I'll try to fix it myself though...can't have everything handed to me on a silvery-blue post.

Thanks.

Edit (Again) - Nevermind those moronic errors I complained about earlier. Instead of treating the HUD and level like a sprite, I'm treating those as images to be pasted with PASTE IMAGE (which corrects the problem of drawing text over sprites) and treating Simon as a sprite.

Here's how it looks so far:

http://unseenstudios.dbpcommunity.com/cvx/screen1.jpg

(Yes, the numbers are made up and I programmed in keys to allow me to modify them all by a keypress...but it is still fun to play around with the health bars)

Next task...getting Simon to walk instead of slide.

My friends' and my website for programming:
http://unseenstudios.dbpcommunity.com

Login to post a reply

Server time is: 2024-11-25 21:21:41
Your offset time is: 2024-11-25 21:21:41