Search found 22 matches

by dwayne_jarvis
Tue Jun 27, 2023 9:33 am
Forum: Hollywood bugs
Topic: Switch statement and using default case.
Replies: 1
Views: 3808

Re: Switch statement and using default case.

Found the issue in my code.

Please ignore.

Regards,

Dwayne
by dwayne_jarvis
Tue Jun 27, 2023 7:07 am
Forum: Hollywood bugs
Topic: Switch statement and using default case.
Replies: 1
Views: 3808

Switch statement and using default case.

Trying to work out if this is a bug or not. Background info first regarding how I scope variables (rightly or wrongly). I scope my variables in every file by declaring them inside an if endif statement at the start and end of the file. Variables that are required to be accessible outside of this are...
by dwayne_jarvis
Sat Jun 10, 2023 2:36 am
Forum: Showcase
Topic: SDL Raycasting demo
Replies: 1
Views: 7631

SDL Raycasting demo

Just a small one this time. Gave this a go in between optimising the SDL Rogue game currently working through. Sometimes it is good to take a quick break. Tried my hand at converting raycasting code and found great tutorial and knocked this out in a few hours. Original tutorial found here https://lo...
by dwayne_jarvis
Mon May 15, 2023 10:15 am
Forum: Code snippets area
Topic: A*Star in Hollywood
Replies: 5
Views: 8826

Re: A*Star in Hollywood

There is an error in the the two for loops in the Draw Function from the astartest.hws file which meant it was not displaying the nodes correctly. mapH and mapW were used in the wrong loop. J correlates to the X coordinates and should have used the mapW variable in the counter and obviously i correl...
by dwayne_jarvis
Mon May 08, 2023 11:39 am
Forum: Code snippets area
Topic: A*Star in Hollywood
Replies: 5
Views: 8826

Re: A*Star in Hollywood

Any questions or comments, please let me know. I will use these algorithms for the sdlRogue demo that I am converting in place of the astarpath find algorithm that Parallel Realities wrote as it appears to be much quicker and can provide the fullpath from the start to end goal in a table. Hope you f...
by dwayne_jarvis
Mon May 08, 2023 11:37 am
Forum: Code snippets area
Topic: A*Star in Hollywood
Replies: 5
Views: 8826

Re: A*Star in Hollywood

Third file is a test demonstrating astar.hws with the empty gridmap.hws When it starts it setups a 1440x900 screen (you can change the size to whatever you like. It then sets the GridMap to one quarter of the ScreenWidth and ScreenHeight. Sets the StartX, StartY position to 0,0 and the GoalX and the...
by dwayne_jarvis
Mon May 08, 2023 11:29 am
Forum: Code snippets area
Topic: A*Star in Hollywood
Replies: 5
Views: 8826

Re: A*Star in Hollywood

second file is an empty gridmap. This can be whatever size you like and doesn't need to be initialised before using. All MAPs must have the following functions as a minimum (NeighboursGet, CostGet and EstimateGet) for them to work with astar.hws. This one has additional functions some of which are n...
by dwayne_jarvis
Mon May 08, 2023 11:26 am
Forum: Code snippets area
Topic: A*Star in Hollywood
Replies: 5
Views: 8826

A*Star in Hollywood

Three files to this one. I will post one at a a time. astar.hws /* MIT License Copyright (c) 2020 Xiejiangzhi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without r...
by dwayne_jarvis
Sun Apr 30, 2023 10:42 am
Forum: Code snippets area
Topic: Quadtree rewritten for Hollywood
Replies: 2
Views: 6026

Re: Quadtree rewritten for Hollywood

I noticed an erorr after I modified my original code to paste it to the forum with the QuadtreeInit Function so I have corrected this and made some basic modifications to make it more flexible. You can pass the maxDepth and it returns a class Object instead of defining a Global variable. Function Qu...
by dwayne_jarvis
Sun Apr 30, 2023 10:19 am
Forum: Showcase
Topic: Converting SDL2 Tutorials from Parallel Realities
Replies: 19
Views: 19407

Re: Converting SDL2 Tutorials from Parallel Realities

In case anyone is interested. I have posted the Quadtree source code with basic usage to the Code Snippets section on the forums.