Jump to content
IGNORED

ABSolutely perfect


Opry99er
 Share

Recommended Posts

16530 DIF=ABS(PR-FCR)+ABS(PC-FCC)

16540 IF DIF>4 THEN 17000

 

 

PC and PR represent a static column and row position on the screen and FCC snd FCR represent a movable piece.

 

Brownie points to who can tell me the shape of the legal playfield for the movable piece. ;)

 

(Coded this into my Jedi Gauntlet game last night and I pretty happy about it)

Link to comment
Share on other sites

Should have something playable soon. Just have to design and code in the remaining level data, then finish tightening up my Force 'move objects' code and then it should be ready for testing. The force playfield code listed above was a big step... I am still playing with the allowable value, right now '4' is working nicely... I may go to 5. We shall see how the difficulty ramps up. :)

  • Like 1
Link to comment
Share on other sites

Interesting.

 

A very nice and simple implementation for this shape.

 

Technically the algorithm is collision detection between two diamonds.

 

The break value will detect a hit between two diamonds of certain sizes.

 

ABSolutely perfect Forcefield ? Hint. Test approach from more than 8 corners of the world (southeast, northwest etc.).

 

;)

Link to comment
Share on other sites

16530 DIF=ABS(PR-FCR)+ABS(PC-FCC)

16540 IF DIF>4 THEN 17000

 

 

PC and PR represent a static column and row position on the screen and FCC snd FCR represent a movable piece.

 

Brownie points to who can tell me the shape of the legal playfield for the movable piece. ;)

 

(Coded this into my Jedi Gauntlet game last night and I pretty happy about it)

If you're not using DIF elsewhere, then just do:

 

16530 IF (ABS(PR-FCR)+ABS(PC-FCC))>4 THEN 17000

Link to comment
Share on other sites

Interesting.

 

A very nice and simple implementation for this shape.

 

Technically the algorithm is collision detection between two diamonds.

 

The break value will detect a hit between two diamonds of certain sizes.

 

ABSolutely perfect Forcefield ? Hint. Test approach from more than 8 corners of the world (southeast, northwest etc.).

 

;)

 

Thanks for the reply. :)

 

I have edge cases handled to where every screen position is accessible... For instance, on an "up" check, IF ROW<2 (blocking the border in row 1), then you cannot move the Force cursor, and similar code for each cardinal direction. You have to get pretty close to the corner to access a corner position, but that is part of the strategy. :) once you are locked on to an object, you cannot move Yoda until you drop the object, and you have a limited number of Force actions per level. Much of the strategy will be positioning Yoda in the correct place BEFORE initiating the Force so that you have the room to move the piece to the proper location in one Force move. :)

  • Like 1
Link to comment
Share on other sites

If you're not using DIF elsewhere, then just do:

 

16530 IF (ABS(PR-FCR)+ABS(PC-FCC))>4 THEN 17000

In TI BASIC though, you may want to separate calculation from the actual comparison check. I noticed when writing Aperture that overloading IF statements with a lot of extra math slowed things WAY down.

 

In fact, Owen, you should make sure you're only doing the diamond check when ABSOLUTELY needed. (To quote the thread title. ;) ) Every calculation takes visible time to do.

Link to comment
Share on other sites

True. This calculation is only done when Force is activated and a move is attempted by the user. Currently it is very fast and responsive. :)

 

Excellent! yeah, with Aperature I ended up breaking up normal movement and falling into completely separate routines so that I could limit the number of IF statements checking the graphic character you were moving into to only the ones necessary.

 

I also found out that statements like this:

 

IF (G=128)+(G=129)+(G=130) THEN 1000

 

Are actually WAY more time-consumptive than this:

 

IF G=128 THEN 1000

IF G=129 THEN 1000

IF G=130 THEN 1000

 

I also would put the most common character encountered in gameplay first so it could exit the loop of checking characters as quick as possible.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...