Quote: " I tried using goto to change the level, but that doesnt work"
I'm not surprised, goto is notorious for increasing the complexity of your code as it jumps around the place. It is a good idea for you to learn what it does, and then only use it when necessary, which, in DBPro, is practically never. It makes bug finding much harder. If you're interested here's a link where goto is being discussed:
http://forum.thegamecreators.com/?m=forum_view&t=178016&b=2
Ok, when making a multi-leveled platformer it is a good idea to keep the contents of each level in its own subroutine or function and then imply that function when necessary. I'll write a small example of the structure which I use when creating projects that require different levels, menus etc. It will basically be psuedocode.
// make what ever variables, types arrays etc here
// create booleans that act as on/off switches for functions/gosubs
// switch for subroutine1
global subroutine1_switch as boolean = 1
// switch for function1
global function1_switch as boolean = 0
// main loop
do
if subroutine1_switch = 1 // on
gosub subroutine1
endif
if function1_switch = 1 // on
function1()
endif
sync
loop
subroutine1:
// events
// somewhere here you will turn subroutine1 off via the switch
// and turn function1 on via the switch
// to turn off, set the switch to 0 and to turn on set it to 1
return
function function1()
// events
// if you want to return to subroutine1 then you will switch it on
// via the switch and turn off function1 via its switch
endfunction
Hope that makes sense. To see it in action, here is an unfinished project of mine, it's not a platformer but it uses the structure described above.
To change the level images, implement it in a gosub or function.
Quote: "Also how can I add a sprite that just moves and when you touch it, it "dies"?"
Unfortunately, all I can say is have a go ( you could fly it out of the screen) and when you get stuck post some code and I'll try to help achieve the desired dying effect.
In my example, the uploaded one, take note as to how I reset the level and this should give you an idea on how to implement changing levels. Remember, its the concept you're looking at.
A clever person solves a problem, a wise person avoids it - Albert Einstein