|
Post by wraith on Oct 15, 2015 14:22:12 GMT -5
Would anyone be kind enough to modify the castlevania.bex example to add variable jump, or maybe have an example I could play around with? I've been experimenting but have thus far been unsuccessful.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 15, 2015 15:54:36 GMT -5
Yeah. I never quite understood moons coding style. Here is my joystick input code that keeps track of how long a key is pressed. Most consider it sloppy.
CONST #true = 1 CONST #false = 0
DECLARE SUB read_joysticks() joystick_state=JOYPAD(0) IF joystick_state.0 THEN joy0up = joy0up + 1 ELSE joy0up = #false IF joystick_state.1 THEN joy0down = joy0down + 1 ELSE joy0down = #false IF joystick_state.2 THEN joy0left = joy0left + 1 ELSE joy0left = #false IF joystick_state.3 THEN joy0right = joy0right + 1 ELSE joy0right = #false IF joystick_state.4 THEN joy0b = joy0b + 1 ELSE joy0b = #false IF joystick_state.5 THEN joy0c = joy0c + 1 ELSE joy0c = #false IF joystick_state.6 THEN joy0a = joy0a + 1 ELSE joy0a = #false IF joystick_state.7 THEN joy0start = joy0start + 1 ELSE joy0start = #false joystick_state=JOYPAD(1) IF joystick_state.0 THEN joy1up = joy1up + 1 ELSE joy1up = #false IF joystick_state.1 THEN joy1down = joy1down + 1 ELSE joy1down = #false IF joystick_state.2 THEN joy1left = joy1left + 1 ELSE joy1left = #false IF joystick_state.3 THEN joy1right = joy1right + 1 ELSE joy1right = #false IF joystick_state.4 THEN joy1b = joy1b + 1 ELSE joy1b = #false IF joystick_state.5 THEN joy1c = joy1c + 1 ELSE joy1c = #false IF joystick_state.6 THEN joy1a = joy1a + 1 ELSE joy1a = #false IF joystick_state.7 THEN joy1start = joy1start + 1 ELSE joy1start = #false END SUB
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 15, 2015 17:16:44 GMT -5
Would anyone be kind enough to modify the castlevania.bex example to add variable jump, or maybe have an example I could play around with? There are a number of ways to implement this, but here's ( a simple demo of ) one way .. s = addsprite(1,1) propsprite s,1,0 y = 472 on vblank gosub main enable interrupt vblank end main: l = j j = joypad(0) if jump then if j.4 then jump++ else jump = 10 if jump > 9 then speed-- y-= speed if y > 472 then jump = 0 y = 472 endif else if j.4 AND l.4 = 0 then jump = 1 speed = 8 y-= speed endif endif movesprite s,284,y>>1 return
|
|
|
Post by wraith on Oct 15, 2015 17:41:47 GMT -5
Thanks guys!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 17, 2015 6:26:51 GMT -5
Theloon: there's nothing wrong, per se, about your joypad routine, but if you're going to declare a constant like #true, you should use it instead of 1 while #false is being used
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 17, 2015 9:24:28 GMT -5
Disregard my last post I completely misread theloons post
|
|
|
Post by tiberiyltim on Jul 31, 2016 14:40:03 GMT -5
How edit spriteset, In what program? player_tiles.bin 6x3? I need example platforming game: sprite, scrolling 2-3 layers and big scene (> 512x480).
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 31, 2016 16:42:08 GMT -5
How edit spriteset, In what program? player_tiles.bin 6x3? I need example platforming game: sprite, scrolling 2-3 layers and big scene (> 512x480). You are going to have to be the first to make such examples. There have been attempts to explain some of these concepts but not in a complete beginner friendly manner (detailed comments etc..). I'd master smaller concepts first. We can help with questions on specific commands and strategies.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 1, 2016 7:12:38 GMT -5
How edit spriteset, In what program? player_tiles.bin 6x3? I need example platforming game: sprite, scrolling 2-3 layers and big scene (> 512x480). You can import your BIN graphics in Sega Genesis Tile Designer by Devster (it doesn't import palettes for those graphics, however). To scroll both background planes, you would do: SetScrollPlane Scroll_A Scroll Left, 1 SetScrollPlane Scroll_B Scroll Left, 1
If you're going for a parallax effect, you'd just change the scroll value to whatever looks appropriate for your game (if you're scrolling one pixel at a time, you can offset the 2nd scroll like this: SetScrollPlane Scroll_A Scroll Left, 1 a = a Xor 1 If a = 1 Then SetScrollPlane Scroll_B Scroll Left, 1 End If
The line a = a Xor 1 will set the variable a to 0 if a = 1, or 1 if a = 0 Hope this helps!
|
|
|
Post by tiberiyltim on Aug 3, 2016 6:58:55 GMT -5
You can import your BIN graphics in Sega Genesis Tile Designer by Devster (it doesn't import palettes for those graphics, however). Thanks! I use Bmp2Tile32 for create sprite 3x3 tiles (24x24 px):
|
|
|
Post by nemezes on Jan 7, 2018 15:25:54 GMT -5
me and some friends were studying how to deal with BEX and we found those castlevania examples by moon.. we made some modifications over the code and got some good results, now we want to share with the comunity. here is what we did, it is version 01.. maybe in the future we can add some enemies. the player can jump, walk, duck (thats not new) and throw some shurikens (now this is new).. --> throw the shurikens is the improvement. also we changed the way the animations work. <-- we let the original PNG images that we use to convert using imagenesis. shinobi.png is the original image org_tiles.png is how we organized the image shinobiOK.png is the image that we open on the imagenesis, the pink color is used as transparency shinobi.bin is the convertion of shinobiOK.png to use with BEX shinobiPaleta.bin are the palette colors to use with BEX. here is micro_shinobiV01 Attachments:micro_shinobiV01.zip (23.24 KB)
|
|
8bit
Burger Head
Posts: 22
|
Post by 8bit on Jan 7, 2018 17:34:35 GMT -5
How make big map in Castlevania exemple? Default width 512 pixels.
|
|
|
Post by nemezes on Jan 10, 2018 18:57:48 GMT -5
now I can handle collisions using a big map on the castlevania example.. in theory it can go up to almost 32600 pixels width. It loads maps of 32 tiles width. in my example it has 4 maps of 32 tiles, total 4*32 = 128 tiles = 1024 pixels width. but, doing this way it has some problems when drawing the maps (using drawtiles) and there is a collision problem when walking right when reaching the end of a map, I do not know how to correct but there is a simple level design way to avoid it (do not put walls on the first columns and on the last columns add 1 tile in height in comparison with the tiles in the first columns). if the comunity want it, I can share here with an attachment..
|
|
|
Post by turrican1024 on Jun 20, 2018 2:47:30 GMT -5
Yes Please add an attachment, I would really like to see how this works with bigger maps.
|
|
|
Post by nemezes on Jun 20, 2018 15:41:44 GMT -5
|
|