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.

DarkBASIC Professional Discussion / Sprite Re Poisiton

Author
Message
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 15th Dec 2014 12:52
Hello guyz,

I have a problem with sprite moivng , lets put it this way:

I imported a sprite, i move it after importing it. Importing other sprites and move them. But once i am clicking on the very first sprite that i imported, it changes it's image, thats because i think i didn't stored the prevvious image numbers and i dont know how to do that here is the code for the sprite when i select it:



Alex Matei CEO
www.alexmatei.com
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Dec 2014 18:02
I don't know what it's changing its image to, as I only see one image being loaded. Also, I'm not sure the purpose of writing out to a file. This code only creates a single sprite. spr and img don't appear to be defined anywhere either. Did you make those global variables and assign them somewhere else?

Let me see if I can help structure a better framework for ya.

In this example, I used the built-in sprite collision. Since it seems to ignore transparency and simply uses bounding boxes, you could replace this with a simpler mathematical approach. I also avoided using arrays to simplify the example.

Simply press the spacebar to load a new sprite to the screen. You can drag sprites around with the mouse.




"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 16th Dec 2014 22:09
Ill try this thank you!

Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2026-07-06 12:11:46
Your offset time is: 2026-07-06 12:11:46