Jump to content

Lillapojkenpåön

Members
  • Content Count

    486
  • Joined

Everything posted by Lillapojkenpåön

  1. Great, then here's another one Edit: FIXED Edit2: Easier to read Edit3: Faster Edit4: edge example for left and right lilla sliden med speedup_FIXED4.bas SMOOOOOOOTH
  2. I made another one that supports variable speeds. If your speed is let's say three and you're going right it will loop and check ; 00111100A ; 01111110 ; 11000011 ; 10111101 ; 11111111 ; 11011011 ; 01111110 ; 00111100B ; 00111100 A ; 01111110 ; 11000011 ; 10111101 ; 11111111 ; 11011011 ; 01111110 ; 00111100 B ; 00111100 A ; 01111110 ; 11000011 ; 10111101 ; 11111111 ; 11011011 ; 01111110 ; 00111100 B ; 00111100 A ; 01111110 ; 11000011 ; 10111101 ; 11111111 ; 11011011 ; 01111110 ; 00111100 B if there is playfield in the way the player will snap to the edge, if not it will move normally. simple_collision_prevention_with_detection_for_variable_speed.bas
  3. Oh, I get it now This is as simple as I could make it simple_collision_prevention_with_detection.bas If we use the correct numbers, the player will overlap one scanline at the top, and be one scanline above the bottom, since it can only be placed every other scanline I guess. so I check one pixel above that for up, and also for the top pixel for left and right to keep it a box, that results in one scanline above and one below.
  4. I found an old collision prevention example here on the forum (collision_prevention_with_detection_2013y_05m_14d_0155t) and started to try to implement it in a little test, it made alot of sense, this is how I understood that one temp5 = ((player0x-15)/4)+1 ;converts player0x right side coordinates to pfpixel coordinates temp3 = ((player0x-15)/4) ;converts player0x left side coordinates to pfpixel coordinates temp6 = ((player0y-1)/8)-1 ;converts player0y coordinates to pfpixel coordinates just above the sprite So I picture those cordinates changing every four regular pixels you move, kinda like a laggy roof that's following you then you pfread that area for pfpixels by checking left and top, and right and top if pfread(temp5,temp6) then if pfread(temp3,temp6) then goto __Skip_Move_Up But then I looked if it had been updated on RT and it had and I'm a little confused with the new one temp5 = (player0x-10)/4 temp6 = (player0y)/8 if temp5 < 34 then if pfread(temp5,temp6) then goto __Skip_Joy0_Down temp4 = (player0x-17)/4 if temp4 < 34 then if pfread(temp4,temp6) then goto __Skip_Joy0_Down temp3 = temp5 - 1 if temp3 < 34 then if pfread(temp3,temp6) then goto __Skip_Joy0_Down Why are there four conversions, and three pfread for up and down? Why check if the horisontal position is less than 34, isn't 31 the highest? And I get that two pfpixels covers the players width but how is the height taken care off for left and right?
  5. Sorry for asking an unrelated question but since you seem to have experiene with tiled, when I open a tileset it doesn't match with the 32x32 grid and some of it's cut out, how would you solve this?
  6. I forgot to say THANKS! that worked great! I'm working on a bB kernel, but the code (level data, logic etc.) in bB needs to end up in different places in the kernel, are there any preprcessor commands that can change where code ends up? or a way to split up the generated assembly from bB to different parts? The DPCplus include file has this bB.asm ; DPC frequencies DPC_waveforms.asm ; rest of bB stuff, ending with graphics bB2.asm but I can't find how it's split into two parts?
  7. Will it be recorded? I really need to learn how to use that thing
  8. Is it possible for you to add the possibility to include text documents that aren't assembly files in bB? I would like to split my code up into different files so I can have them open in different windows and include them in the main source that I compile. Example: include "init.bas" or include "init.txt" or whatever only this works asm include "init.asm" end I tried to do that and put another end at the beginning and asm at the end of the included file but didn't work, maybe there is a way allready? Or else I request it 😀
  9. gosub bB gosub __MySubroutine ; jumps to MySoubroutine rem put outside of code __MySubroutine rem code block return function C/C++ void MyFunction(); // function prototype, needed for the compiler if you want to put the function below where it's being called from // you could put the function here and remove the prototype // we jump from the main function to MyFunction // variables are only locally known to the function they are defined in // to create a global variable that can be accessed by any function define it here outside of any function int main() { MyFunction(); // jumps to MyFunction } void MyFunction() // function declaration { //code block }
  10. on...goto bB dim _Counter = a on _Counter goto __case_1 __case_2 __case_3 __case_4 __case_5 __case_6 __case_7 goto __break ; if _Counter > 6 __case_1 rem code block goto __break __case_2 rem code block goto __break __case_3 rem code block goto __break __case_4 rem code block goto __break __case_5 rem code block goto __break __case_6 rem code block goto __break __case_7 rem code block __break switch C/C++ int _Counter; switch (_Counter) { case 1: // code block break; case 2: // code block break; case 3: // code block break; case 4: // code block break; case 5: // code block break; case 6: // code block break; case 7: // code block break; }
  11. For Loop bB dim _LoopCounter = temp5 for _LoopCounter = 0 to 9 player1y[_LoopCounter] = _Y_POS[_LoopCounter] next rem put outside of code data _Y_POS 10, 20, 30, 40, 50, 60, 70, 80, 90 end For Loop C/C++ int _PlayerY[9]; // Create an array of nine integers int _LoopCounter; const int _Y_POS[9] = {10, 20, 30, 40, 50, 60, 70, 80, 90}; // Read-Only array, same as a data table in bB for (_LoopCounter = 0; _LoopCounter < 9; _LoopCounter++) { _PlayerY[_LoopCounter] = _Y_POS[_LoopCounter]; }
  12. Boolean bB def _Aristocrat=a{0} def _Bangladesh=a{1} def _Cola=a{2} def _Didrick=a{3} _Aristocrat=0 _Bangladesh=0 _Cola=1 _Didrick=1 if _Aristocrat && !_Bangladesh then _Cola = 1: _Didrick = 0 if !_Aristocrat && _Bangladesh then _Cola = 0: _Didrick = 1 Boolean C/C++ bool _Aristocrat = false; bool _Bangladesh = false; bool _Cola = true; bool _Didrick = true; if (_Aristocrat && !_Bangladesh) {_Cola = true; _Didrick = false;} if (!_Aristocrat && _Bangladesh) {_Cola = false; _Didrick = true;}
  13. Integer variables bB Dim _Aristocrat = a Dim _Bangladesh = b Dim _Cola = c Dim _Didrick = d _Aristocrat = 0: _Bangladesh = 0: _Cola = 0: _Didrick = 0 if _Aristocrat > _Bangladesh then _Cola = 25: _Didrick = 1 else _Cola = 50: _Didrick = 0 bB Comparison Operators: rem = equal to rem <> not equal rem > greater than rem < less than rem >= greater than or equal to rem <= less than or equal to bB Logical Operators: rem && AND rem || OR rem ! NOT Integer variables C/C++ int _Aristocrat; int _Bangladesh; int _Cola; int _Didrick; _Aristocrat = 0; _Bangladesh = 0; _Cola = 0; _Didrick = 0; if (_Aristocrat > _Bangladesh) {_Cola = 25; _Didrick = 1;} else {_Cola = 50; _Didrick = 0;} C/C++ Comparison Operators: // == equal to // != not equal // > greater than // < less than // >= greater than or equal to // <= less than or equal to C/C++ Logical Operators: // && AND // || OR // ! NOT
  14. I looked into C/C++ a couple days ago and realized how similar it was to bB, I know I'm not the only one who only knows bB so I thought I would share my findings since I found it very inspiring, especially considering SpiceC. I will make different posts with commonly used bB code and it's equivalent in C/C++ and have an index to them here in the first post, and hopefully people chime in with their knowledge, corrections or questions.
  15. Would that be minus? I have a basic loop question, you can use bpl with both x and y right? So if any of them is > 128 it will not loop, is that how it works?
  16. I think he meant that you have to add an extra line in those tables since it never loops on zero so pretend the second line is zero, I think you could just load 64 and dey at the beginning of the loop instead of bottom to keep it the same size
  17. Well I have very little to do so if you want to pm me the bas I'll convert it to dpc+. You dont have to use it, it would just be fun for me
  18. Oh yeah now that you mention it i remember they are over complicated and use pointers and a shared 48pixel subroutine that I never understood myself
  19. Why don't you look at the assembly in one of your many titlescreens? My loop looks like this Ldy #logoheight Logoloop Sta wsync Sty temp1 Lda logo0,y Sta grp0 Lda logo1,y Sta grp1 Lda logo2,y Sta grp0 Ldx logo4,y Lda logo5,y Sta temp2 Lda logo3,y Ldy temp2 Sta grp1 Stx grp0 Sty grp1 Sta grp0 Ldy temp1 Lda logocolor,y Sta colup0 Sta colup1 Dey Bpl Logoloop
  20. Cool game, what if it was called rescue dog and if you get hit and "die" you start controlling The dog and you can run over and jump on The dudes chest and resesitate him, and if the dog gets hit he lays on his back with his legs straight up in The air and you can go and put him up on his legs again, only if both get hit its finito, I would like to see those animations by your friend
  21. I made another version with just one pointer, I think it's pretty optimized BIGGER_LEVELS_optimized_2019-08-27.bas
  22. Yeah I tried the sequential variables both in regular ram and dpc ram but when i pushed fire which was suppose to change the color of the sprite, i just got different color on each line that moved upwards, but I'm a noob so if you can get that to work I would appreciate it
  23. Hmm how do I ask this.. Let's say you could shoot enemies all over the screen, and that when an enemy is shot something travels from it's location down to the score, but I want it to allways take one second to travel there even if it's far away or close to the score, you would have to calculate a 8.8 speed that makes the thing reach it's destination within said time, possible? anybody know of some similar code?
  24. I have made an example that can do that, allmost exactly the same If someone can color an entire sprite the color of a variable without tables that could be usefull tho, that's what I wanted to do originally that led to these examples.
  25. I have this setup, it's the most popular for making cartmods, don't think you need the adp-054 adapter for 2600 https://www.ebay.com/itm/PRG-113-GQ-4X-Willem-Programmer-ADP-054-16-Bit-EPROM40-42pin-Tool-007-UV-Eraser/112220589648?hash=item1a20de4e50:g:6iMAAOSwcH5cEZ7s I have made nes, snes, master system and mega drive carts with it, never atari 2600 tho.
×
×
  • Create New...